How to hack YARPP plugin to find related posts for custom post type?
Be wary that the plugin makes extensive use of the options table for caching. This can bring large sites to a crawl.
Be wary that the plugin makes extensive use of the options table for caching. This can bring large sites to a crawl.
You can do: if( ‘video’ == $post->post_type ) $play_button = ‘/images/btn-play.png’; elseif( ‘slideshow’ == $post->post_type ) $play_button = ‘/images/btn-ss.png’; Then render the button with: <img src=”https://wordpress.stackexchange.com/questions/4052/<?php echo get_bloginfo(“template_directory’) . $play_button; ?>” class=”play” /> Hope that helps!
If I understand you right, you’re looking for custom header support for custom post types. By default WordPress does not offer such a thing for custom post types. The features that are offered for CPTs are listed here: Arguments for register post type(). So this is not easily possible.
When you create a custom menu item for the custom post type archive you have to include the entire url and not just /your-custom-post-type-name. If you use the entire url the wordpress url rewrite function will check it against all the other menu items as well as against all your pages and so on. What … Read more
Can I create a loop with multiple post types and specify different $args for each post type? Simply put no… you can’t have a single query instance with three differing sets of arguments. The reason why is pretty simple, the query class will only take one array of arguments per instance. If you want differing … Read more
Codex has very decent explanation of get_template_part() logic: Assuming the theme folder is wp-content/themes, that the parent theme is twentyten, and the child theme is twentytenchild, then the following code — <?php get_template_part( ‘loop’, ‘index’ ); ?> will do a PHP require() for the named files in this order: wp-content/themes/twentytenchild/loop-index.php wp-content/themes/twentytenchild/loop.php wp-content/themes/twentyten/loop-index.php wp-content/themes/twentyten/loop.php Basically you … Read more
simple and short. up to vimpress latest version 0.91 which was developed at 2007-07-13 no you can’t.
The basic answer – you can easily load template (or any PHP file really) with *drumroll*load_template(). 🙂 As for best way to implement your custom feed, I think it would make sense to do it by analogue with native WP feeds. You register feed name and handler function with add_feed() and load template in that … Read more
If I’m understand the question right…. first login to the admin section. then click on “categories” its in the “Posts” accordion box. When your there you’ll see all your categories. Next, following your example, you need to make “current”, “future”, and “past” all children of “tasks”. this should achieve the desired URL. Let me know … Read more
global $post or $post_type to check for your CPT; Post Status Transitions hooks to redirect on specific changes to the post; wp_redirect().