WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to offset posts by categories in Recent Articles section on my homepage? (6 posts)

  1. twaye1@aol.com
    Member
    Posted 1 year ago #

    Right now my homepage has redundancies between featured category posts and the recent articles. I would like to alter my recent articles section so that different articles are visible. I understand that this is possible by adding offset code but I'm not a programmer and need help with this aspect. Is there a way to select which individual articles are visible in the recent articles sections as well? Please see the link to my site below. Also I would like to center the text for the category heading and sidebars. I tried inputing 'text-align: center;' and it didn't work. Please help!

  2. Scott Fennell
    Member
    Posted 1 year ago #

    You didn't link to your site.

    You can try adding this to index.php:

    <?php
    if ( ! is_admin() && $query->is_main_query() && is_home() ) {
    $query->set( 'offset', '10' );
    }
    ?>

    That should cause your main query to skip the 10 most recent posts.

  3. twaye1@aol.com
    Member
    Posted 1 year ago #

    here's my web address: http://www.haute-beauty.com

  4. twaye1@aol.com
    Member
    Posted 1 year ago #

    Hi, when I added the suggested code to the index.php I got the following error message on my home page. I even went back and removed the suggested code and I still got the same error message. Now my home page is broken. What happened?

    Parse error: syntax error, unexpected T_STRING in /hermes/bosweb/web246/b2467/ipg.hautebeautycom/wp-content/themes/Impulse/includes/recent_articles.php on line 13

  5. twaye1@aol.com
    Member
    Posted 1 year ago #

    I was able to input my original recent_articles.php and remove the error message. But I still need answers to my original ?'s

  6. Scott Fennell
    Member
    Posted 1 year ago #

    Ah, sorry, I didn't realize you had no understanding of php.

    You need to get a baseline understanding of how themes work, otherwise you'll just be copy N pasting with no understanding, which is a waste of everyone's time. I recommend the excellent "digging into WordPress themes" by Chris Coyier.

Topic Closed

This topic has been closed to new replies.

About this Topic