Tag Archive for Custom-Post-Type Posts yielding 404 when permalinks set to postname

Try give a name for your rewrite, like so: ‘rewrite’ => array( ‘slug’ => ‘news-updates-archive’, ‘with_front’ => true, ‘feeds’ => false, ‘pages’ => true, ) So you will avoid any problem. Also, the last functions you’re using are unnecessary. You can setup it on register_post_type: ‘taxonomies’ => array(‘post_tag’, ‘category’), PS: Try empty your trash also … Read more

Removing /author/ slug from URL gives 404

You are just doing it wrong. Adding a per user rewrite rule will just bloat the rewrite “table” and slow down the URL parsing process. You need to come up with a generic rewrite rule which will work for all users, or write an alternative url parsing using the ‘do_parse_request filter. Your core problem is … Read more

page nested 3 levels deep shows 404

This should not be a problem unless you’ve a same slug page / post in your TRASH somewhere. Check your Pages / Posts trash and see if you’ve “series” slug there? If not, try creating another page and see if its just a matter of the page name / slug or its happening with all … Read more

Load custom PHP on a custom URL via a plugin

Use is_page(). The is_page() function accepts page title, slug or id. Documentation <?php if(is_page(‘myscript’)) { include ‘/path/to/myscript.php’; } ?> UPDATE To add it to the content, you have two options 1. Find the content function in your template Find either the_content() or get_the_content() in your template. Place it immediately after that function (or before if … Read more

Add prefix to link url

Based on this question about retrieving WordPress post slug, you could put together a link like the following: <a href=”http://www.example.com/md/<?php global $post; echo $post->post_name; ?>”>link text</a> Whether that goes to a functioning page or not, I don’t know. It seems like you may want to change rewrite rules in the functions but I’m not sure … Read more