WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Oxygen theme] Increase number of Recent Articles/Primary Posts? (4 posts)

  1. 4rightchords
    Member
    Posted 1 year ago #

    Hello all,

    I'm not a CSS pro, but I'm alright enough. However, scanning the CSS for Oxygen as is, I can't seem to begin to pinpoint a) whether it's possible to increase the number of Primary posts and b) what the heck I'd even edit!

    Which brings me here for help...

    Is it possible to increase the number of posts that will show when classed as primary to something higher than 3 (I'd prefer 5)?

    If so, how would I go about it?

    (My site is otmblog.com)

  2. diazjean
    Member
    Posted 1 year ago #

    Hello 4rightchords,

    Hope you are well.

    I can see you find a solution to your problem.

    Could you please share the solution with us?

    Thank you in advance for your return,

    Jean

  3. Raxxi
    Member
    Posted 1 year ago #

    Please share how you did it, can't seem to figure it out :(

  4. 4rightchords
    Member
    Posted 1 year ago #

    I went in and tweaked the main style sheet. Be aware that if you do this to the main Oxygen theme and not a child theme, you'll have to re-do it after every theme update. It takes two minutes, so I don't mind.

    Go to Appearance, then Editor. On the right are links to the many CSS pages for the theme. Click on Front Page one. To change the number of Primary posts, find this part of the code:

    <?php $args = array( 'post__not_in' => get_option( 'sticky_posts' ), 'posts_per_page' => 10, 'meta_key' => '_oxygen_post_location', 'meta_value' => 'primary' ); ?>

    Notice it says 10 for posts per page for my code. It will say 5 or 6 for the standard code. Change the number to whatever you want.

    To make sure the page didn't get too long for scrolling, I also changed the number of secondary posts from 12 to 6 here:

    <?php $args = array( 'post__not_in' => get_option( 'sticky_posts' ), 'posts_per_page' => 6, 'meta_key' => '_oxygen_post_location', 'meta_value' => 'secondary' ); ?>

    Hope this helps!

Topic Closed

This topic has been closed to new replies.

About this Topic