WordPress.org

Ready to get started?Download WordPress

Forums

Need help linking to main category (1 post)

  1. esmarts
    Member
    Posted 5 years ago #

    I am trying to create a Directory plugin for wp 2.6
    I have the layout and design done now I have to link the links in the post to the category the post is in...

    So I created a category called Directory.
    The plugin is designed to implant itself in a post like all the other plugins do using a comment line like

    <!--tgd_directory-->

    ok here is the problem I am having

    When a link is created in the plugin through the admin area and displayed in the post (category = directory, it is not linking to the category the post is in (directory).

    So when I click a link in the directory it takes me to
    http://localhost/&wp_dir=sub&cat_id=1

    I need it to add the category that the post is in.
    like this
    http://localhost/?cat=3&wp_dir=sub&cat_id=1
    ?cat=3 is the directory category.

    The code I have to link to this in the php is this.

    <a href='{$cat_id}&wp_dir=sub&cat_id=$result[id]'><b>$result[name]</b></a>

    $cat_id is what i would use for eching the directory (?cat=3) category right?

    Can someone please help me I am lost lol

    Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic