Function to get permalink of custom post type archives?

Is there a function that will return the permalink to a custom post types archives that is available to use in WordPress? Something like: get_cpt_permalink(“events”) which will return http://example.com/events/ when has_archive => true on it. If not what would I need to home brew my own? I’m thinking I would need to read $wp_rewrite and … Read more

How to improve WordPress security by hiding non public facing files?

e.g. curl -I http://ma.tt/blog/wp-config.php 200 OK The wp-config.php is not public facing file, since it currently just return blank page, so why not return 404 instead. (so will not be cached by Google) Also, for file such as readme.html, it should be hidden as it disclose your wordpress version, e.g. http://ma.tt/blog/readme.html So, currently I have … Read more

Prevent page slug from interfering with custom post type archive permalink?

In my plugin, I’m creating a custom post type that has an archive and uses the rewrite parameter to choose a slug: $args = array ( ‘public’ => true, ‘has_archive’ => true, ‘rewrite’ => array(‘slug’ => ‘lessons’, ‘with_front’ => false) ); register_post_type (‘my_plugin_lesson’, $args); With this code, I get an archive of the ‘my_plugin_lesson’ posts … Read more

echo post-permalink without http and www

I have this line … <div class=”permalink”><?php the_permalink(); ?></div> and the result on my page looks like this … http://mysite.com/whatever/post-or-so I guess it could also look like this … http://www.mysite.com/whatever/post-or-so However I’d like to have just mysite.com/whatever/post-or-so without the http:// or www in front of it. What is the best and easiest way to do … Read more

Combine Multiple Categories Into One URL Slug

I have a WordPress website with 20+ categories. To make it easier to navigate I want to decrease the categories, but at the same time keep the original categories. In other words I want to be able to query multiple categories with a category group or a virtual slug. Example categories: /category/apples/ /category/pears/ /category/bananas/ I … Read more