Is get_permalink also the canonical URL?
Unless you are doing something weird with your URL structure (and maybe even then), the answer is yes according to this blog post.
Unless you are doing something weird with your URL structure (and maybe even then), the answer is yes according to this blog post.
Is your rewrite rule in your .htaccess well configured? Can you post it here? Should be configured like this: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Source: Codex page on pretty permalinks
Just a tip: the structure of the headings with anchor tags is the following on that site: <h2><a id=”something” name=”something”></a>SOMETHING</h2><p>Description of that thing</p> However, the paragraph of the Corks section also contains the anchor tag of the following Wood section: <a name=”wood”></a>. Then the paragraph is closed and comes the <h2 id=”wood”>WOOD (clean, untreated)</h2> It … Read more
After sleeping over the problem I decided to the code and tried this: <a href=”https://twitter.com/share?url=&text=<?php the_title(); ?>: <?php echo urlencode(get_permalink($post->ID)); ?> &via=username&count=horizontal” class=”custom-tweet-button”>Tweet</a> All I can say is: it works as it should be. Next thing on my agenda is to incorporate a custom url shortener. PS: It’s worth a mention that if you use … Read more
Looks like it’s not something can be done without digging into the code. However i found a plugin the fits my needs pretty well: http://wordpress.org/extend/plugins/taxonomic-seo-permalinks/ with this you can just set /%your-taxonomy%/%postname%/ in the permalinks settings page and your done!
If you don’t want to search custom post types at all, you can add ‘exclude_from_search’ => true to your registration args.
When visiting that page it would actually create an empty config file. To fix the issue, I copied the config file from my http://example.com/ directory to the http://example.com/wordpress/ one, it works fine now.
How to change “attachment_id” in attachment permarlink?
Now the question is why does WP only put the word “date” in when the permalink is “/%post_id%/%postname%/”? Because the WP_Rewrite class method get_date_permastruct only looks specifically for a clash between %date% and %post_id% tags. To get this date structure with other numeric-based post permalink structures, you can manipulate the date structure directly: function wpa57228_date_structure() … Read more
I used this to enable yearly and monthly archive for custom post type. Just drop in this code into your functions.php file. This will add your custom rule right on the top of the Rules array. NB – WordPress uses rules array to store rewrite rules. <?php function wpse22992_custom_post_rewrite( $rewrite_rules ) { $cpslug = ‘contest_recipe’; … Read more