Display only certain categories @ home page

  • Unknown's avatar

    Hi!
    I would like my homepage to display only the post from certain categories. Looking around I found here http://en.support.wordpress.com/display-posts-shortcode/
    that one can add this to a page:
    [display-posts tag=“nutrition,vida diaria” posts_per_page="20"]
    and it will do what I’m looking for… (the categories listed are the ones I need to use)

    Where can I add that to my homepage coding so it does what I need it to do?

    Thank you!
    Mónica.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi Mónica.

    You will need to create a normal page that contains the display posts shortcode and then set that as your front page. The front page support article explains it better than I ever could so follow the steps there and if you’re still having trouble you can respond here and let us know which bit is proving difficult.

  • Unknown's avatar

    Hey!
    Thank you so much!
    Did not thing about that option!
    I’ll let you know how it goes!
    Mónica.

  • Unknown's avatar

    Hi,
    the thing I just realized is that I LOVE the way the post come out with this theme I bought, and I have the feeling that by doing a static page it will not display the post the way I like it…
    I have been reading this
    http://en.support.wordpress.com/display-posts-shortcode/
    and did a new page where I wrote the code that supposedly should work:
    [display-posts tag=“nutrition,vida diaria” posts_per_page="20"]
    But it does nothing…

    I am not at all a web master, but I have the feeling that the problem should be solved by adding this:
    [display-posts tag=“nutrition,vida diaria” posts_per_page="20"]
    somewhere on the code for the home page that already exists….

    Any thoughts?

    Thank you,
    Mónica.

  • Unknown's avatar

    Can you post the link to the page you’re trying the shortcode out on so I can take a look. There’s no guarantee the shortcode will display the posts just like your theme does unfortunately but if you let me see what you’ve come up with so far there might be something we can do!

  • Unknown's avatar

    Ok….
    Let’s see if I get it:

    This is the website:
    http://amorperrunocr.com/
    The green square is something I do not want on my homepage.

    This is the page I created, I posted the shortcode ([display-posts tag=“nutrition,vida diaria” posts_per_page="20"])
    https://laskaprovetcre.wordpress.com/wp-admin/post.php?post=311&action=edit
    and as you can see, nothing comes up

    Basically I am making a series of posts into a kind of “listing” of places and I do not want those post to come up at the home page…

  • Unknown's avatar

    Ooh I can’t see it because you haven’t published it yet. I’ve just tried it on my test blog and if you use something like the below you can at least show the posts with the tag you want, including featured images and excerpt.

    [display-posts tag=“nutrition,vida diaria” include_excerpt="true" posts_per_page="20" image_size="medium"]

    If you could publish the page (but hide it from your menu so that people aren’t likely to stumble upon it accidentally) there are ways we can style it with CSS to look closer to how you’d like.

    Let me know the URL if you publish it and what changes you’d want!

  • Unknown's avatar

    Hi!
    Thank you very much for hanging in here with me!

    I made the page my static home page, and I copy/pasted the text you used on your test blog… and nothing yet…

    http://amorperrunocr.com/

    Is there really no way to add this to the original code of the site? The reason why I bought this template is because I love the way the home page looks… I hate to think I will loose it because of this… I guess I will have to figure out a way to make the other part of the site with just pages and not with posts…. :(

  • Unknown's avatar

    To get rid of the original green box it looks like you would need to set a featured image for that post (which will show up in place of the green title box).

    On to the current problem. Firstly, it looks like you are using categories not tags so it should be category=”nutircion” in the shortcode instead – try switching that and see if it starts working.

    Secondly, do you have anything else on the page? It looks a lot different to when I preview your theme with a similar set-up (I can’t test more thoroughly as your theme is a premium one and I can’t purchase it just for testing).

    Could you take a screenshot of how your edit screen looks for that page so I can check how you’re entering everything to see if there’s anything that’s causing a problem.

    I would definitely not recommend using pages instead of posts just for display purposes, you will miss out on all the great features that come with posts, feeds, widgets, categories and tags, etc.

    All themes can either show your main posts or a static page, there is no way to show an archive page as your front page – this is part of how all of WordPress.com works.

    If we can get the shortcode to work then we can start working on setting it up in a grid layout with the featured images – it will take a bit of work so I hope you’re up for it, I know I am :)

  • Unknown's avatar

    Hi hallluke!
    Thank you so much for your help! I am trying to figure out another way to solve my problem because I definitely do not want to loose the way the home page looks… If I decided to take this road again I will come find you!!!!
    And yes, you were right, mayor mistake to use “tags” instead of “category”!
    Thank you!

  • The topic ‘Display only certain categories @ home page’ is closed to new replies.