Can I style single post that are in multiple catergories?
Is there a better way to do what I’m trying to do? Yes, use a mobile plugin or use your RSS feed to style a mobile version.
Is there a better way to do what I’m trying to do? Yes, use a mobile plugin or use your RSS feed to style a mobile version.
Install the Custom Post Template plugin and create different templates for your project pages. This works like page templates. You may also consider a custom post type for your projects to use different taxonomies, meta data and templates.
According to the documentation on that plugin, the capability to create custom fields is included.
My first suspicion that something is amiss is this: $post = $wp_query->post; You shouldn’t need to do this. Anywhere that the query conditionals are already setup, the conditionals will assume the current Post ID. So, that suggests a couple things: The specified categories don’t actually exist. I will assume this not to be true, since … Read more
I think what you’re looking for is the WordPress Template Hierarchy. Basically you can just name the template single-{custom-post-slug}.php and put it in the right directory. Update Now that I understand what you’re actually asking: I bet you could hook {$type}_template, which is called by get_query_template(). It’s expecting a path to the template which has … Read more
You could set a url parameter to change the display so that the URL could be the same, then have your QR code do a pass-through to the desired page. Without knowing how the QR codes are setup and such, I can’t offer much more on high-level implementation than that. The way to switch the … Read more
The article you’re using is quite old, from ~2009. There are much better cleaner ways of doing commenting. As a guide, follow this: http://ottopress.com/2008/wordpress-2-7-comments-enhancements/ This is the definitive guide to implementing Comments post v2.7, and Otto is widely respected in the community. Firstly, your comments code uses have_posts() to check if there are comments, instead … Read more
remove_filter( ‘the_content’, ‘printme_add_link’ ) will prevent the link from being placed. You can just call printme_add_link() in your template to generate the print button. Alternately, you can just add_query_arg( ‘print’, 1, get_permalink() ) and use that as the link if you would prefer to do the link some different way.
Here is the idea add_filter(‘the_content’, ‘testfunc’); function custom_formatter($matches){ return “<strong>{$matches[0]}</strong>”; } function testfunc($content) { $pattern = “$\<p.*\>(.*)\<\/p\>$”; $content = preg_replace_callback($pattern, ‘custom_formatter’, $content); return $content; } However, you will need a better regular expression in $pattern variable as this regex may be very poor. in the custom_formatter function you can do the formattings you want.
I’ve not tested this, but the following is the method you shoulduse. Don’t use query_posts. $cats_of_post= get_the_category(); if($cats_of_post){ $cat_id = (int) $cats_of_post[‘0’]->term_id; $related = get_posts(array( ‘numberposts’ => 5, ‘category’ => $cat_id, ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘exclude’ => )); global $post; $temp_post = $post;?> <div class=”related-posts”> <?php if( $related ): ?> <ol> <?php foreach … Read more