简体   繁体   中英

Dynamic link to page in Wordpress

So I'm attempting to create a dynamic WordPress link that displays within a post which would change according to the subject page that displays that post.

The link is displayed in a Bootstrap breadcrumb list. I'm using the WordPress "Content View" plugin to gather all posts of a given category ex. "Public Space", and display them on a specific "Public Space" page I've created within WordPress.

The dynamic link currently in use displays the proper title of the category of post being viewed, "Public Space", but it links back to the specific category page instead of my "Public Space" page that uses the proper formatting I need through the "Content View" plugin.

Is there any way to accomplish this without creating individual .php page files for each subject?

Any help would be greatly appreciated!

Here's my code for the breadcrumb:

<a href="#"><?php the_category('title_li='); ?></a> 

Link to the website post with the dynamic breadcrumbs:

http://parkerrichard.com/wordpress/public-space/judgement/

Link to the page the "Public Space" breadcrumb should dynamically link to (and change depending on the post category):

http://parkerrichard.com/wordpress/public-space

Thanks,
Parker

Sorry, I didn't read your post fully. Your problem is you're using a plugin to do templating work, when you could edit the "category.php" page to look like you want.

But if you have to use the plugin, then try this:

Go to Settings > Permalinks in your admin menu.

Then set your permalink structure to custom, and put this in the box:

%category%/%postname%

Then underneath that in your category permalink name field, put a single period - .

Now your category permalinks will have: http://yoursite.com/wordpress/category-name/ instead of yoursite.com/wordpress/category/category-name/

They should link up to the right place now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM