Need help linking to main category
-
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
https://localhost/&wp_dir=sub&cat_id=1I need it to add the category that the post is in.
like this
https://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.
- The topic ‘Need help linking to main category’ is closed to new replies.