OnStartups

Total Pageviews

Sponsored Ad

Mashable!

Start-ups & VC

Google Photos Blog

UltraDNS - DNS Matters - Blog

Ignite Social Media

Todays Clouds

ChaiDomains.com

Eye-Fi

Displaying items by tag: joomla

Thursday, July 21, 2011

WordPress Permalink – How to Add Your Own Permalink Structures

WordPress Permalink – How to Add Your Own Permalink Structures: "The conversion back to our pretty permalink is achieved through the redirect_canonical function [wp-includes/canonical.php] which is tied to the template_redirect hook.

How to Add Your Own WordPress Permalinks

Recently, I wanted to add permalinks to the gallery objects in my Media Library plugin. Here are the steps -

Translate gallery objects into the new gallery permalink structure.
Add additional rules to our WordPress blog so that it can translate our gallery permalinks into a proper query, and then back again.
Suppose our WordPress blog permalink structure is

/articles/%postname%
and our desired gallery permalink structure is

/gallery/%gallery%
1. Translate gallery objects into our new gallery permalink structure.

We translate permalinks from our original blog structure into our gallery structure by hooking into the get_permalink function [wp-includes/link-template.php]. As of WordPress 2.9.2, we can use the post_link hook as is shown in the code below -"

1 comment:

  1. When considering using your 'blog-rolling button" for a long passafe consider that original master content producers such as the one who publicly shared this important content above may often realize the valuable backlink might be even more valuable than that little bit of extra traffic generated by a content teaser.

    ReplyDelete

Gabfire Premium Themes