Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

secondary permalink of post WordPress

  • SOLVED

I need of create an alternative url/permalink of a post, for example:

I have this url of post:

http://www.blog/category/post_slug.html

and I want make an url clone of this post, so:

http://www.blog/category/post_slug/more.html

this secondary url it must recognize the same post but I will add an IF check for showing different content.

is possibile?

I must use url roles?

---------------------------------------------

I need that after I added in custom field of a post a value, so the secondary permalink will show this values.

in my example:

this is post of review of procudt http://www.blog/category/post_slug.html

and this is tech data of review product http://www.blog/category/post_slug/more.html


for manage parent and child pages you know a specify plugin that I can use? so I try if this can resolve my problem.

----------------------------------

I tried with this rewrite_rules but it redirect to principal post:
add_action('generate_rewrite_rules', 'work_list');

function work_list($wp_rewrite) {
$newrules = array();
$newrules['(.*)/scheda-tecnica.html$'] = 'index.php?pagename=$matches[1]&tipopg=scheda-tecnica';
$wp_rewrite->rules = $newrules + $wp_rewrite->rules;
}

Answers (3)

2010-11-02

TheLoneCuber answers:

@powerflash We have a plugin that does (nearly) exactly what you need. We will post this link here once we hear back from WPQuestions admin about the practice of 'linking out' as answers (we're just new in here and are not sure of that policy. We've sent them an email).

Or if any other regular WPQ Answerers can let us know, that'd be great. Can you link out as an answer where it solves/answers the Asker's question?


powerflash comments:

I think that you can post the links


TheLoneCuber comments:

@powerflash Here is a live working demo of our WP Conditional Content plugin: [[LINK href="http://wpconditionalcontent.com" title="WordPress Conditional Content"]]wpconditionalcontent.com[[/LINK]]

Be sure to click through to the post (single.php) where you will see full content, and then links to the different content versions.

<strong>Info</strong>
- There is only <em>one post</em> on the demo website
- The post is in 3 categories
- The content for the post is displayed according to the category viewed.

For example, on the demo site you will see the same post in 3 category with <em>specific content for each category</em>.

[[LINK href="http://wpconditionalcontent.com/nintendo/r-type"]]wpconditionalcontent.com/nintendo/r-type[[/LINK]]
[[LINK href="http://wpconditionalcontent.com/sega/r-type/"]]wpconditionalcontent.com/sega/r-type[[/LINK]]
[[LINK href="http://wpconditionalcontent.com/iphone/r-type/"]]wpconditionalcontent.com/iphone/r-type[[/LINK]]

I'm not sure if this will meet your requirements 100%, but it is very close and straight-out-of-the-box. It depends a little on your permalinks. Considering how the plugin works, the simplest method for you would be to create a "More Info" category and the extra information you want to show would do exactly that. But via a slightly different URL structure. In this case the URLs would look like this ....

Post URL: www.blog/category/page_slug/
More Info URL: www.blog/more-info/page_slug/


<strong>Plugin Options Include</strong>
- Auto Boxes: Automatically adds conditional content meta boxes to wp-admin/post.php for each category selected.
- Manual Boxes: numerical entry for number of conditional content meta boxes to add to wp-admin/post.php
* You will not have to worry about custom fields - it's all automatic
* Conditional Content boxes are fully WYSIWYG supported


<strong>A few things to note ...</strong>
* Permalinks need to be set to category/postname
* This is a premium plugin


TheLoneCuber comments:

*** Correction ***

Your URLs would <strong>not</strong> be page-slug, they <strong>would be post-slug</strong>.

Post URL: www.blog/category/post_slug/
More URL: www.blog/more-info/post_slug/

2010-11-02

Jermaine Oppong answers:

What you're asking for is similar to setting parent and child pages, so the url clone would be a child of the previous.

You may have to expand on what you've said 'cos at the moment I'm getting mixed ideas.

2010-11-02

idt answers:

Have you tried looking into Custom permalinks plugin (http://wordpress.org/extend/plugins/custom-permalinks/)?


idt comments:

Can you please take a look at this post: [[LINK href="http://dojo.codegreene.com/2010/redirecting-to-parent-or-child-pages-in-wordpress/"]][[/LINK]]


idt comments:

Reposting, the link was not posted above. Please take a look at this post: http://dojo.codegreene.com/2010/redirecting-to-parent-or-child-pages-in-wordpress/


idt comments:

I think that the redirect to parent in that post I posted above would work for you.

Example, you create a page http://www.blog/category/page_slug/ then create a child page http://www.blog/category/page_slug/more/. If you have no content for http://www.blog/category/page_slug/more/, you just use the Redirect Up template page (in the link I posted above) so http://www.blog/category/page_slug/more/ redirects to http://www.blog/category/page_slug/.