Forums

Displaying a link to category instead of link to page? (7 posts)

  1. kelp
    Member
    Posted 5 years ago #

    Hello,
    I'm already using a plugin to hide a category from showing up on the front page and on the sidebar with the other categories. Now, is there a plugin to display a link to this hidden category on my navigation(not on category list)?

  2. moshu
    Member
    Posted 5 years ago #

    Who could tell... if we don't know what your "navigation" is? Where is your navigation? What code is used to make it work? Which theme? Is there a link to the blog?
    The more details you give - the more chances to get a meaningful answer.

  3. kelp
    Member
    Posted 5 years ago #

    http://www.dealoverflow.com/

    Basically, there's a right bar with the categories listed and the navigation is in the header.php. I've already hidden the category named "Articles". Now, I would like to place a link from the navigation to the "Articles" category.

  4. moshu
    Member
    Posted 5 years ago #

    I assume the horizontal navigation uses the wp_list_pages template tag.
    1. Can't you just add manually another list item?
    2. Or, you could use the Redirectify plugin and create a Page titled "Articles" and redirect it to that category.
    http://www.redalt.com/downloads/ - where the plugin is

  5. kelp
    Member
    Posted 5 years ago #

    Hey,
    how would I change the code so that when the user is on the category, the button will have the active class on?


    <code>
    <li><a <?php if (is_home()) echo "class=\"active\""; ?> href="<?php bloginfo('url'); ?>"><span>Home</span></a></li>
    <li><a <?php if (is_home()) echo "class=\"active\""; ?> href="<?php bloginfo('siteurl'); ?>/category/articles"><span>Articles</span></a></li>
    </code>

    I added the second list coded manually. The first one is the one that came with the layout. The first one reads that if the user is on the home page, it will be "active". How would I make it so when the user is on the link from the second list, the list will change into the "active" class? I'm not so good at PHP. I just know HTML and CSS.

    All I know is that I would have to change the following: (is_home()) so it corresponds to the articles category, but I'm not sure what to change it to.

  6. moshu
    Member
    Posted 5 years ago #

  7. kelp
    Member
    Posted 5 years ago #

    Oy, I'm getting the following:
    http://codex.wordpress.org/Conditional_Tags

    But I'll go to the site in an hour, hopefully it will be back up.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.