WordPress.org

Support

Support » How-To and Troubleshooting » Show only Catagories not sub catagories

Show only Catagories not sub catagories

  • iantheripper
    Member

    @iantheripper

    Hi,
    I have been trying to stop the sub catagories showing on the parent catagory
    I have tried editing my archive.php to add the code
    <? if ((is_category()) && in_category($wp_query->get_queried_object_id())) { ?>

    but the log just keeps saying unexpected ;
    and i cant seem to get it to work
    the code is from this site
    lonewolf

    and the page i am trying to remove sub catagories from is
    page

    any ideas would be really helpfull as I am really struggling.

    Ian

Viewing 6 replies - 1 through 6 (of 6 total)
  • iantheripper
    Member

    @iantheripper

    Thanks for that idea, I tried it and it is currently running on the linked page but it doesnt seem to take effect (i suspect that the Arjuna X theme is messing it up)

    any other ideas 🙂

    thank you.

    Look at the “style posts differently” in the article The Loop and use something like that in your Category Templates.

    Related:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

    iantheripper
    Member

    @iantheripper

    OMG
    I messed up just one line of code! that is mind boggling!

    I shall try and learn what I need to do.

    I suspect I will be back 🙂

    thank you for your help, off to try to injest/digest/vomit 😉

    iantheripper
    Member

    @iantheripper

    I have read that information but it does not practically help me. thank you for the help but I need something less general.

    Does anyone know of a SIMPLE solution or sample code to help?

    thank you

    Ian

    thelaw
    Participant

    @thelaw

    I still can’t believe the URL structure is weak in WordPress.

    For various purposes I don’t need to list, all I want is for the posts of every category’s URL to show up as mysite.tld/category/postname/ and not mysite.tld/category/subcategory/postname/ as I don’t really need it. This is especially the case if the post is part of the main category, like I have it. There should be some method of having a post keeping a primary category so that the URL structure is based off of that category.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show only Catagories not sub catagories’ is closed to new replies.