Topic Resolution: Resolved
  • Closed
  • Andrew Heyer
    Spectator
    May 18, 2015 at 3:18 am #17544

    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/

    Roman
    Spectator
    Posts: 3147
    May 18, 2015 at 8:03 pm #17556

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

    Andrew Heyer
    Spectator
    Posts: 7
    May 18, 2015 at 9:55 pm #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
    Posts: 7
    May 18, 2015 at 9:55 pm #17561
    This reply has been marked as private.
    Roman
    Spectator
    Posts: 3147
    May 19, 2015 at 8:14 pm #17575

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

    Andrew Heyer
    Spectator
    Posts: 7
    May 20, 2015 at 4:31 am #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
    Posts: 7
    May 20, 2015 at 5:41 am #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