• Resolved butkovich83

    (@butkovich83)


    I’d like to start by saying I LOVE this theme! So clean, and elegant. Here’s my question. I’d like the home page to just be the top three posts that are shown, and the menu up top. But currently it shows the posts below as well. Is there a way to get rid of the posts towards the bottom? It would be the perfect site for me, if I could just limit it to the top three, and the menu.

    Thank you!
    Butkovich83

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Theme Author alexvtn

    (@alexvtn)

    Hi @butkovich83
    thank you for your feedback ??

    You could create a child theme and insert the following PHP code inside the functions.php file:

    function annalite_custom_post_limit( $limit, $query ) {
    
        if (  $query->is_main_query() &&  $query->is_home()  ){
            return 'LIMIT 0';
        }
    
        return $limit;
    }
    
    add_filter( 'post_limits', 'annalite_custom_post_limit', 10, 2 );
    

    Please let me know

    Alex

    Thread Starter butkovich83

    (@butkovich83)

    Good Evening Alex ??

    Thank you so much for your help! I have the child theme created, but keep getting a syntax error:

    Parse error: syntax error, unexpected ‘&’ in /home3/limeisla/public_html/voicetothepast/wp-content/themes/anna-lite-child/functions.php on line 9

    Line 9 being:
    if ( $query->is_main_query() && $query->is_home() ){

    I’ve tried figuring this out on my own, but am coming up empty handed :/ Any suggestions?

    Theme Author alexvtn

    (@alexvtn)

    Hi @butkovich83

    it’s strange, i tested successfully this code inside a new child theme.

    Could you please attach a screenshot to see the code of the functions.php file?

    Thank you

    Alex

    Thread Starter butkovich83

    (@butkovich83)

    Thanks for your patience ??

    https://www.voicetothepast.com/php.png

    Let me know if I’ve done something incorrect!

    Thank you!

    Theme Author alexvtn

    (@alexvtn)

    Hey @butkovich83

    you should replace all HTML Entities

    Please copy the code into a text editor, then paste it on the WordPress editor

    Let me know

    Thank you

    Alex

    Thread Starter butkovich83

    (@butkovich83)

    Good Morning Alex!

    This is almost perfect! For some reason it is showing no items found now… is it possible to get rid of that? If not, I’ll make it work. I appreciate your help already! Thank you again!

    https://www.voicetothepast.com/

    Theme Author alexvtn

    (@alexvtn)

    Hey @butkovich83

    You could set a static page as homepage or add the following custom css code to hide this box

    body.home .masonry-container { display:none; visibility:hidden;}

    Please let me know

    Alex

    Thread Starter butkovich83

    (@butkovich83)

    PERFECT!! Thank you so much for your help!!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Editing the Home Page?’ is closed to new replies.