WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Creativix Theme: Wanna increase amount of articles on the frontpage (7 posts)

  1. havingfun
    Member
    Posted 1 year ago #

    If you can visit youandthekids.com for me, you will notice it shows two recently published articles below the slide. I would like to show maybe six rather than just two. Can I even do this? Would the theme allow me? If so, how?

    Thanks in advance.

  2. potentweb
    Member
    Posted 1 year ago #

    It is difficult to say without looking at the theme in action including the admin area. Some theme have it so you can't some are designed to be more flexible.

  3. keesiemeijer
    moderator
    Posted 1 year ago #

    Try changing this in index.php [untested]:

    $args = array( 'meta_key' => 'feat_front', 'meta_value'=> '1', 'suppress_filters' => 0, 'post_type' => array('post', 'page'), 'post_status' => 'publish', 'numberposts' => 2, 'orderby' => $feat_sort, 'order' => $feat_order);
    
    		$myposts = get_posts( $args );
    
    		if(!$myposts) {
    
    			$args = array('suppress_filters' => 0, 'post_type' => array('post'), 'post_status' => 'publish', 'numberposts' => 2, 'orderby' => $feat_sort, 'order' => $feat_order);
    
    			$myposts = get_posts( $args );
    
    		}

    to this:

    $args = array( 'meta_key' => 'feat_front', 'meta_value'=> '1', 'suppress_filters' => 0, 'post_type' => array('post', 'page'), 'post_status' => 'publish', 'posts_per_page' => 6, 'orderby' => $feat_sort, 'order' => $feat_order);
    
    		$myposts = get_posts( $args );
    
    		if(!$myposts) {
    
    			$args = array('suppress_filters' => 0, 'post_type' => array('post'), 'post_status' => 'publish', 'posts_per_page' => 6, 'orderby' => $feat_sort, 'order' => $feat_order);
    
    			$myposts = get_posts( $args );
    
    		}
  4. havingfun
    Member
    Posted 1 year ago #

    @keesiemeijer

    Thank you so much! That worked perfectly. There is now a large space to the right of the articles and above the list of latest articles. By chance, would you know which php I can paste an ad code to fill this spacing? Would it still be within index.php? Can I bring the "latest articles" section up to the top or will it have to stay in the bottom?

    youandthekids.com

  5. potentweb
    Member
    Posted 1 year ago #

    That is what I was afraid of would happen if you just changed the number of returns without taking the design into consideration.

    Change:

    #column-content {
    background: url(images/center-column.png) repeat-y;
    width: 923px;
    float: left;
    padding-bottom: 20px;
    margin-left: 7px;
    }

    to

    #column-content {
    background: url(images/center-column.png) repeat-y;
    width: 923px;
    float: left;
    padding-bottom: 20px;
    position: relative;
    margin-left: 7px;
    }

    And also change:

    .latest-posts {
    width: 220px;
    padding: 10px 10px 10px 20px;
    float: left;
    right: 0;
    }

    to

    .latest-posts {
    width: 220px;
    padding: 10px 10px 10px 20px;
    float: left;
    position: absolute;
    right: 0;
    }
  6. havingfun
    Member
    Posted 1 year ago #

    @potentweb

    You are right again...and thanks again!

  7. potentweb
    Member
    Posted 1 year ago #

    :) No problem! Been coding for over 10 years so I better be right!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.