——this is used the code for display your limit pages content on the HTML DIV ———–the in witch $latestnews = getPageContent(35); use toge (35) is pages id and (0,106) display character limit————————-
<?php
$latestnews = getPageContent(35);
$latestnews = substr($latestnews,0,106);
echo $latestnews.’…’;
?>
============ function.php=====================
function new_excerpt_length($length) {
return 38;
}
add_filter(‘excerpt_length’, ‘new_excerpt_length’);
if(!function_exists(‘getPageContent’))
{
function getPageContent($pageId)
{
if(!is_numeric($pageId))
{
return;
}
global $wpdb;
$sql_query = ‘SELECT DISTINCT * FROM ‘ . $wpdb->posts .
‘ WHERE ‘ . $wpdb->posts . ‘.ID=’ . $pageId;
$posts = $wpdb->get_results($sql_query);
if(!empty($posts))
{
foreach($posts as $post)
{
return ($post->post_content);
}
}
}
}
=================================
————————————————-This code is used for the display of the singal pages (by pages id)———————————-
<p><?php query_posts(‘page_id=161’);
if(have_posts()) : the_post(); ?></p>
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark”><?php the_title(); ?></a></h2>
<?php the_content();
endif;
?>
How to display text length in wordpress
============= Add code in function.php file =======
function twentyten_excerpt_length( $length ) {
return 90;
}
add_filter( ‘excerpt_length’, ‘twentyten_excerpt_length’ );
if ( ! function_exists( ‘twentyten_continue_reading_link’ ) ) :
/**
* Returns a “Continue Reading” link for excerpts
*
* @since Twenty Ten 1.0
* @return string “Continue Reading” link
*/
function twentyten_continue_reading_link() {
return ‘ <a href=”‘. get_permalink() . ‘”>’ . __( ‘Continue reading <span>→</span>’, ‘twentyten’ ) . ‘</a>’;
}
endif;
——————Add function in index.php file/ single.php file ————
<?php the_excerpt(); ?>
How to Add fevicon in wordpress
======================Add the code for fevicon======
<link rel=”shortcut icon” href=”<?php bloginfo(‘template_url’); ?>/Wireless-icon.ico” type=”image/x-icon” />
How to remove the Google Open Sans fonts
How to remove the styleseet link
<link rel=’stylesheet’ id=’open-sans-css’ href=’//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.8′ type=’text/css’ media=’all’ />
link rel=’stylesheet’ id=’open-sans-css’ href=’//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.8′ type=’text/css’ media=’all’ />
Place the following in the functions file for your theme.
function replace_open_sans() {
// Kill the original style
wp_deregister_style(‘open-sans’);
// Replace it with your own (just as an example, I included only the 300 weight)
wp_register_style( ‘open-sans’, ‘http://fonts.googleapis.com/css?family=Open+Sans:300’ );
wp_enqueue_style( ‘open-sans’);
}
add_action( ‘wp_enqueue_scripts’, ‘replace_open_sans’ );
<h1> How to create widget in WordPress by for loop </h1>
for($i=2;$i<=5;$i++){
register_sidebar( array(
‘name’ => __( ‘Sidebar ‘.$i, ‘wisten’ ),
‘id’ => ‘sidebar-‘.$i,
‘description’ => __( ‘Appears on blog pages. Those are selectable on admin panel’, ‘wisten’ ),
‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</aside>’,
‘before_title’ => ‘<h3 class=”widget-title”>’,
‘after_title’ => ‘</h3>’,
));
}