Filtering posts to different pages (wp)

10 replies
  • WEB DESIGN
  • |
I am using Cloriato theme. I have a main/homepage then I have a "news" tab on the nav bar and a "service area" tab with post content specific to the tab displayed.

I dont want "service area" posts in "news" or vice-versa. I thought by selecting the proper category on the post that it would separate them to display in the proper tab. But I just have the same post content showing under both tabs.

How can I separate/filter post to only show in/under specific tabs? Is there a plugin? or another way of setting my theme up. I do not want to set a static page and post page
Any help is appreciated
#filtering #pages #posts #wordpress
  • Profile picture of the author David V
    What is the url of your site? Be easier to see what your doing first.
    {{ DiscussionBoard.errors[7603145].message }}
  • Profile picture of the author copilu0
    There are several ways to do that and the best I can think now without seeing your website are either to create new templates for each page or you can replace your menu links with links to each category.Please tell us your website address so we can take a better look at it.
    {{ DiscussionBoard.errors[7603216].message }}
  • Profile picture of the author David V
    Originally Posted by Big Gee View Post

    But I just have the same post content showing under both tabs.
    You shouldn't have them both showing under both links.
    Say you have 2 categories "news" and "service area" and then various posts listed for each category.
    First:
    Make sure on the post edit page you Don't have both categories selected.

    Go to appearance/menus and add your menu (which likely you've done) then add the 2 categories to the menu.
    When you click the menu bar links to each one, they will only show those posts filed under those categories.
    I tested this under the Cloriato lite theme and it's works fine.

    A more fine grained way to do it is to take advantage of WordPress template hierarchy.
    You can have a custom category template for each one by naming them "category-slug.php" or "category-id.php".
    Slug and ID are the actual slugs/id of your categories.
    So you would create "category-news.php" and "category-service-area.php"

    You can create them by basing them off the category.php file

    WordPress will look for templates in this order:
    • category-slug.php
    • category-ID.php
    • category.php
    • archive.php
    • index.php

    The Cloriato theme uses an external loop.php file so you'd need to modify that with a conditional or create specific loop files for your category templates.

    There are plugins that could do filter modifications, but it's a very poor way to do it.
    Custom templates are not that difficult.

    InkThemes support will likely be able to tell you specifically what to do, and maybe even do it for a small fee.


    Hope this helps.
    {{ DiscussionBoard.errors[7603314].message }}
  • Profile picture of the author Big Gee
    Thank you for the help everyone. My website is keystonelocksmithsanjose[dot]com
    If you click Service areas tab on the nav bar it shows both posts. The same happens with the locksmith news tab in the nav bar. I dont want the post crossing over into other areas. Only areas I want them to display in
    {{ DiscussionBoard.errors[7604101].message }}
  • Profile picture of the author David V
    Assuming the theme is functioning correct, it looks like your selecting more then one category on the post edit page.
    I tested this in the same theme and it works fine.
    But if you accidentally select more then one category on the post edit page it will do what is happening to you. Double check. Also double check the menu page.
    {{ DiscussionBoard.errors[7604201].message }}
    • Profile picture of the author Big Gee
      Originally Posted by David V View Post

      Assuming the theme is functioning correct, it looks like your selecting more then one category on the post edit page.
      I tested this in the same theme and it works fine.
      But if you accidentally select more then one category on the post edit page it will do what is happening to you. Double check. Also double check the menu page.
      I checked both posts. In the category options I only have the box selected for the related subject. Not sure what to do in the menu sections. I have a pages menu and a categories menu but they have not been added to the menu. And their are no boxes checked. The rest of what you see in the sidebar is generic.

      I may just choose to eliminate one of them if I cant fix it. I'm gonna try and see if maybe I can find a plugin. Thank you for your help.
      {{ DiscussionBoard.errors[7608393].message }}
      • Profile picture of the author David V
        Originally Posted by Big Gee View Post

        I have a pages menu and a categories menu but they have not been added to the menu. And their are no boxes checked. The rest of what you see in the sidebar is generic.
        Navigate to menus.
        On the left sidebar the box named "categories" should have your two categories listed.
        Place check marks next to them and then add to menu.

        EDIT: If you can't see "categories" go up to the screen options tab and select it to make it visible.

        Whatever else you have there, remove.
        That will give you the two categories in the menu bar.
        You can drag them up or down to change the order.
        {{ DiscussionBoard.errors[7608412].message }}
  • Profile picture of the author David V
    I just noticed something. If you click the categories on your sidebar it's fine.
    So whatever you entered/selected for the top main menu is the problem.
    Now, if you don't want the page to say "Category Archives: Locksmith News" you can remove the word Archives from the template, or you'll need to create a custom template to display them.
    {{ DiscussionBoard.errors[7604210].message }}
  • Profile picture of the author leliahawkins31
    this question is very simple,

    well when you create the page and you want that page belongs to the First tab, at the right side see the PAGE ATTRIBUTE and select what is the parent of your page you creating and your DONE.

    hope this works.

    thanks
    {{ DiscussionBoard.errors[7604228].message }}
    • Profile picture of the author David V
      Originally Posted by leliahawkins31 View Post

      well when you create the page
      thanks
      He's not creating pages, but displaying posts from a specific category.
      {{ DiscussionBoard.errors[7604238].message }}

Trending Topics