Expanding blog area on homepage

Ask Green Lantern Theme Settings & Configuration Related Issues Here

Moderator: forum_m

ajsmith227
Posts: 45
Joined: November 12th, 2014, 4:44 am

Expanding blog area on homepage

Post by ajsmith227 » September 8th, 2016, 10:03 pm

I'd like to put more content here...I can only display 3 lines currently. How can I expand this?

Thank you
Attachments
Screen Shot 2016-09-08 at 10.28.26 AM.png

support_staff
Posts: 6970
Joined: February 26th, 2015, 1:40 pm

Re: Expanding blog area on homepage

Post by support_staff » September 9th, 2016, 10:58 am

Hi,

Please make child theme Directory and open functions.php file.

Now copy below lines of code and paste into Child Theme's functions.php file.

Code: Select all

function custom_excerpt_length( $length ) {
	return 110;
	}
add_filter( 'excerpt_length', 'custom_excerpt_length' );
Here you can change 110 as per your choice.

Save the changes.

Thanks.

ajsmith227
Posts: 45
Joined: November 12th, 2014, 4:44 am

Re: Expanding blog area on homepage

Post by ajsmith227 » September 12th, 2016, 8:41 pm

Where should I put this code in the functions.php? At the end causes errors.

Thanks!!!
AJ

support_staff
Posts: 6970
Joined: February 26th, 2015, 1:40 pm

Re: Expanding blog area on homepage

Post by support_staff » September 14th, 2016, 10:38 am

Hi,

Please put this code after "your code goes below" and close the php tag i.e ?>

Thanks.

ajsmith227
Posts: 45
Joined: November 12th, 2014, 4:44 am

Re: Expanding blog area on homepage

Post by ajsmith227 » September 14th, 2016, 10:36 pm

I do not see that in my code? Please advise.

Code: Select all

<?php //Functions ; 
define('WEBLIZAR_TEMPLATE_DIR_URI',get_template_directory_uri());	
define('WEBLIZAR_TEMPLATE_DIR',get_template_directory());
define('WEBLIZAR_THEME_FUNCTIONS_PATH',WEBLIZAR_TEMPLATE_DIR.'/functions');

require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/menu/weblizar_menu_walker.php');
require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/weblizar-js-css/weblizar_js_css.php');
require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/custom/custom-post-type.php');  
require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/custom/metabox.php');
require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/custom/taxonomies.php'); 
require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/resize_image/resize_image.php');
require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/comment-list/comment-function.php');  
require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/custom/wl-footer-contact-widgets.php'); 
require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/custom/wl-footer-recent-posts.php'); 
require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/custom/flickr-widget.php'); 
require( WEBLIZAR_THEME_FUNCTIONS_PATH . '/shortcodes/shortcodes.php'); 
require(WEBLIZAR_TEMPLATE_DIR . '/theme-options/theme-update-checker.php'); //THEMEUPDATOR
//require('update_notifier.php');
	//wp title tag starts here
	function weblizar_head( $title, $sep )
	{	global $paged, $page;		
		if ( is_feed() )
			return $title;
		// Add the site name.
		$title .= get_bloginfo( 'name' );
		// Add the site description for the home/front page.
		$site_description = get_bloginfo( 'description' );
		if ( $site_description && ( is_home() || is_front_page() ) )
			$title = "$title $sep $site_description";
		// Add a page number if necessary.
		if ( $paged >= 2 || $page >= 2 )
			$title = "$title $sep " . sprintf( _e( 'Page', 'weblizar' ), max( $paged, $page ) );
		return $title;
	}	
	add_filter( 'wp_title', 'weblizar_head', 10, 2);
	
	add_action( 'after_setup_theme', 'weblizar_setup' ); 	
	function weblizar_setup()
	{
	
		// Load text domain for translation-ready
		load_theme_textdomain( 'weblizar', WEBLIZAR_THEME_FUNCTIONS_PATH . '/lang' );	
		// This theme uses wp_nav_menu() in one location.
		register_nav_menu( 'primary', __( 'Primary Menu', 'weblizar' ) ); //Navigation
		// theme support 	
		$args = array('default-color' => '000000',);
		add_theme_support( 'custom-background', $args); 
		add_theme_support( 'automatic-feed-links'); 
		add_theme_support( 'post-thumbnails' ); //supports featured image
		
		// This theme supports a variety of post formats.
		add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status') );
		global $content_width;
		//content width
		if ( ! isset( $content_width ) ) $content_width = 720; //px
		
		require_once('weblizar-default-settings.php'); //default settings
		require( WEBLIZAR_TEMPLATE_DIR . '/theme-options/option-panel.php' ); // for Custom Menus	
		
		// setup admin pannel defual data for index page		
		$weblizar_default_theme_settings = weblizar_default_settings();	
		
		$weblizar_saved_theme_settings = get_option('weblizar_GL_pro'); // get existing option data 		
		if($weblizar_saved_theme_settings) {
			$weblizar_saved_theme_settings = array_merge($weblizar_default_theme_settings, $weblizar_saved_theme_settings);
			update_option('weblizar_GL_pro', $weblizar_saved_theme_settings);	// Set existing and new option data			
		} else {
			add_option('weblizar_GL_pro', $weblizar_default_theme_settings);  // set New option data 
		}
	}
		// Read more tag to formatting in blog page 
	function weblizar_content_more($more)
	{  global $post;							
	   return '<div class="blog-post-details-item blog-read-more"><a href="'.get_permalink().'">Continue Reading....</a></div>';
	}   
	add_filter( 'the_content_more_link', 'weblizar_content_more' );
	
	// Remove read-more form front blog section  
	function change_excerpt_more( $more ) {    return ''; 	}
	add_filter('excerpt_more', 'change_excerpt_more');
	
	add_action( 'widgets_init', 'wl_widgets_init');//REGISTER sIDEBAR aND fOOTER wIDGETS
		function wl_widgets_init() {
		/*sidebar*/
		register_sidebar( array(
				'name' => __( 'Sidebar', 'weblizar' ),
				'id' => 'sidebar-primary',
				'description' => __( 'The primary widget area', 'weblizar' ),
				'before_widget' => '<div class="sidebar-block" >',
				'after_widget' => '</div>',
				'before_title' => '<h3 class="h3-sidebar-title sidebar-title">',
				'after_title' => '</h3>',
			) );

		register_sidebar( array(
				'name' => __( 'Footer Widget Area', 'weblizar' ),
				'id' => 'footer-widget-area',
				'description' => __( 'footer widget area', 'weblizar' ),
				'before_widget' => '<div class="col-md-3 col-sm-3 footer-col">',
				'after_widget' => '</div>',
				'before_title' => '<div class="footer-title">',
				'after_title' => '</div>',
			) );
		}
		/* Breadcrumbs  */
	function weblizar_breadcrumbs() {
    $delimiter = '';
    $home = 'Home'; // text for the 'Home' link
    $before = '<li>'; // tag before the current crumb
    $after = '</li>'; // tag after the current crumb
    echo '<div class="breadcrumb-container"><ol class="breadcrumb">';
    global $post;
    $homeLink = home_url();
    echo '<li><a href="' . $homeLink . '"><i class="icon-home"></i>' . $home . '</a></li>' . $delimiter . ' ';
    if (is_category()) {
        global $wp_query;
        $cat_obj = $wp_query->get_queried_object();
        $thisCat = $cat_obj->term_id;
        $thisCat = get_category($thisCat);
        $parentCat = get_category($thisCat->parent);
        if ($thisCat->parent != 0)
            echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
        echo $before . 'Archive by category "' . single_cat_title('', false) . '"' . $after;
    } elseif (is_day()) {
        echo '<li><a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a></li> ' . $delimiter . ' ';
        echo '<li><a href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '">' . get_the_time('F') . '</a></li> ' . $delimiter . ' ';
        echo $before . get_the_time('d') . $after;
    } elseif (is_month()) {
        echo '<li><a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a></li> ' . $delimiter . ' ';
        echo $before . get_the_time('F') . $after;
    } elseif (is_year()) {
        echo $before . get_the_time('Y') . $after;
    } elseif (is_single() && !is_attachment()) {
        if (get_post_type() != 'post') {
            $post_type = get_post_type_object(get_post_type());
            $slug = $post_type->rewrite;
            echo '<li><a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->singular_name . '</a></li> ' . $delimiter . ' ';
            echo $before . get_the_title() . $after;
        } else {
            $cat = get_the_category();
            $cat = $cat[0];
            //echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
            echo $before . get_the_title() . $after;
        }
    } elseif (!is_single() && !is_page() && get_post_type() != 'post') {
        $post_type = get_post_type_object(get_post_type());
        echo $before . $post_type->labels->singular_name . $after;
    } elseif (is_attachment()) {
        $parent = get_post($post->post_parent);
        $cat = get_the_category($parent->ID);
        $cat = $cat[0];
        echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
        echo '<li><a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a></li> ' . $delimiter . ' ';
        echo $before . get_the_title() . $after;
    } elseif (is_page() && !$post->post_parent) {
        echo $before . get_the_title() . $after;
    } elseif (is_page() && $post->post_parent) {
        $parent_id = $post->post_parent;
        $breadcrumbs = array();
        while ($parent_id) {
            $page = get_page($parent_id);
            $breadcrumbs[] = '<li><a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a></li>';
            $parent_id = $page->post_parent;
        }
        $breadcrumbs = array_reverse($breadcrumbs);
        foreach ($breadcrumbs as $crumb)
            echo $crumb . ' ' . $delimiter . ' ';
        echo $before . get_the_title() . $after;
    } elseif (is_search()) {
        echo $before . 'Search results for "' . get_search_query() . '"' . $after;
    } elseif (is_tag()) {
        echo $before . 'Posts tagged "' . single_tag_title('', false) . '"' . $after;
    } elseif (is_author()) {
        global $author;
        $userdata = get_userdata($author);
        echo $before . 'Articles posted by ' . $userdata->display_name . $after;
    } elseif (is_404()) {
        echo $before . 'Error 404' . $after;
    }
    if (get_query_var('paged')) {
        if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())
            echo ' (';
        echo __('Page', 'weblizar') . ' ' . get_query_var('paged');
        if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())
            echo ')';
    }
    echo '</ol></div>';
}

		//PAGINATION
		function kriesi_pagination($pages = '', $range = 2)
{  
     $showitems = ($range * 2)+1;  

     global $paged;
     if(empty($paged)) $paged = 1;

     if($pages == '')
     {
         global $wp_query;
         $pages = $wp_query->max_num_pages;
         if(!$pages)
         {
             $pages = 1;
         }
     }   

     if(1 != $pages)
     {
         echo "<div class='pagination'><a href='".get_pagenum_link($paged - 1)."' class='prev'>&laquo; </a>";
         if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>&laquo;</a>";
         if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo;</a>";

         for ($i=1; $i <= $pages; $i++)
         {
             if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
             {
                echo ($paged == $i)? "<a class='current'>".$i."</a>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>";
             }
         }

         if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>&rsaquo;</a>";  
         if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>&raquo;</a>";
         echo " <a href='".get_pagenum_link($paged + 1)."' class='next'>&raquo;</a></div>\n";
     }
}
?>

support_staff
Posts: 6970
Joined: February 26th, 2015, 1:40 pm

Re: Expanding blog area on homepage

Post by support_staff » September 15th, 2016, 10:39 am

Hi,

Please make child Theme Directory First.

Now open your child theme's functions.php file.

Now copy below lines of code

Code: Select all

function custom_excerpt_length( $length ) {
   return 110;
   }
add_filter( 'excerpt_length', 'custom_excerpt_length' );

and paste this code into child theme's functions.php file after "your code goes below"

Save the changes.

Thanks.

ajsmith227
Posts: 45
Joined: November 12th, 2014, 4:44 am

Re: Expanding blog area on homepage

Post by ajsmith227 » April 22nd, 2017, 1:52 am

Where is "your code goes below" ?

support_staff
Posts: 6970
Joined: February 26th, 2015, 1:40 pm

Re: Expanding blog area on homepage

Post by support_staff » April 22nd, 2017, 11:00 am

Hello,

In your child theme directory replace code of functions.php with below file -

https://pastebin.com/tWYwAyyN

Thanks.

ajsmith227
Posts: 45
Joined: November 12th, 2014, 4:44 am

Re: Expanding blog area on homepage

Post by ajsmith227 » April 25th, 2017, 2:35 am

Thank you. We are making some progress.

Changing "110" does not add much more. "910" does as much as "110"

What am I missing?

support_staff
Posts: 6970
Joined: February 26th, 2015, 1:40 pm

Re: Expanding blog area on homepage

Post by support_staff » April 26th, 2017, 1:49 pm

Hello ajsmith227,

First Step is to make a Child theme of your theme. Then go to its directory and open functions.php file.
Now, In the end of this file paste this code and save it.

Code: Select all

function custom_excerpt_length( $length ) {
   return 110;
   }
add_filter( 'excerpt_length', 'custom_excerpt_length' );

Post Reply

Return to “Theme Settings & Configuration”