Topic Resolution: Resolved
  • Creator
    Topic
  • #17544

    Andrew Heyer
    Spectator
    Been thanked: 0 times

    I want to achieve the fallowing

    1) sidebar widgets on front page
    2) The posts layout that comes with your theme (so no 3’rd party posts if possible)
    3) Be able to only show posts by category in my home page

    I have been able to do this all but one by:
    -having a static page
    -<?php query_posts( ‘cat=2’ ); ?> <- Adding this piece of code to filter my posts to show only cat 2
    <!–BEGIN #primary .hfeed–>

    However when I use a static page I do not get the widget sidebar. It doesn’t even show up in my “manage in customizer” menu, only when I select widgets.

    (I have tried removing <?php query_posts( ‘cat=2’ ); ?> to see if this was causing the sidebar to disappear and still no luck)

    Having the ‘latest’ posts appear as my front page works however I have the fallowing problems if I choose this route
    – Layout changed to where even if I have my page setup to have the the sidebar to the right using theme options, when I have more than 2 posts the layout is not how it should be. It has the two posts taking the full width of the page and then places the sidebar under the whole page

    – Also I am unsure how I can filter my latest posts by category

    I really love this theme and would hate to change because I cant get my front page how I want it, any help is tremendously appreciated

    Evolve plus
    http://ultimate.tennistucson.com/

Viewing 6 replies - 1 through 6 (of 6 total)
Replies
  • Roman
    Keymaster
    Post count: 2538
    Been thanked: 29 times
    #17556 |

    I will need the login details to investigate further…please post it in the private reply

    Andrew Heyer
    Spectator
    Post count: 7
    Been thanked: 0 times
    #17560 |

    Thanks for the reply

    I seem to have given one piece of information incorrect and that is that
    <?php query_posts( ‘cat=2′ ); ?>

    Is not a fix, it shows the category of post on every page.

    Also, I have read keeping your front page set to ‘latest posts’ is better for SEO. Do you have any knowledge if this is true?
    If so then I would prefer to be able to solve the problems heading this route if possible

    Your help is very much appreciated, thank you.

    Andrew Heyer
    Spectator
    Post count: 7
    Been thanked: 0 times
    #17561 |
    This reply has been marked as private.
    Roman
    Keymaster
    Post count: 2538
    Been thanked: 29 times
    #17575 |

    when you are using query_posts() function, after the loop wp_reset_query() must be implemented.

    Andrew Heyer
    Spectator
    Post count: 7
    Been thanked: 0 times
    #17588 |

    Ok I see, it does filter the front page exactly how I want it to look. However when clicking on a posts it shows a repeat of the 3 posts again. Not the actual post content.

    Thanks again for helping, it’s very appreciated

    Andrew Heyer
    Spectator
    Post count: 7
    Been thanked: 0 times
    #17590 |

    Got it resolved placing this in the function.php

    // This lets us filter front page categories
    function exclude_category($query) {
    if ( $query->is_home() ) {
    $query->set(‘cat’, ‘-3’);
    }
    return $query;
    }
    add_filter(‘pre_get_posts’, ‘exclude_category’);

    Regardless, thanks for taking the time for helping me out

Viewing 6 replies - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.