A solution to set metatags with my page generating plugin?

Theoretically, you could hook into wp_head and echo your tags from within your callback: function wpse_36395_meta_tags() { echo ‘<meta name=”description” content=”Your Description” />’; } add_action( ‘wp_head’, ‘wpse_36395_meta_tags’ ); But note that if a theme already has the tag(s) hardcoded into its <head></head> section, you’ll end up with duplicate tags. Whether that’s more desirable than missing … Read more

If Query In Sidebar

Assign the return value of the first check to a variable, and test if there is something in it: if ( $quote = get_post_meta( get_the_ID(), ‘FeaturedQuote’, TRUE ) ) { ?><h3 class=”featuredquote”><?php the_title(); ?></h3> <blockquote><span class=”bqstart”>&#8220;</span><?php echo $quote; ?> <span class=”bqend”>&#8221;</span></blockquote> <?php } elseif ( $img = get_post_meta( get_the_ID(), ‘InsertFullImg’, TRUE ) ) { echo … Read more

Editing Category RSS Feeds

FYI, you should never hack the WordPress core files. Instead, WordPress provides the handy rss2_item action hook. All we need to do is check if we’re on a category feed or not: function wpse_99336_category_feed_item() { if ( is_category() && get_the_post_thumbnail() ) { printf ( ‘<featured-item>%s</featured-item>’, wp_get_attachment_url( get_post_thumbnail_id() ) ); } } add_action( ‘rss2_item’, ‘wpse_99336_category_feed_item’ );

How to remove the cufon script from Dzonia Lite theme [closed]

You can remove scripts with wp_dequeue_script(): function wpse99450_remove_cufon() { wp_dequeue_script( ‘inktheme-confu-ui’ ); // inktheme-confu-ui is the script’s handle, according to your posted code } add_action( ‘wp_enqueue_scripts’, ‘wpse99450_remove_cufon’, 20 ); // set priority to ’20’ so it will run later than the default But be careful — as @gdaniel pointed out, if the theme depends on … Read more

User’s total comment count excluding comments on their own posts

I’m not aware of any WordPress functions that do this, so you can try to play with this kind of query (untested): function get_custom_user_comments_count( $uid ){ global $wpdb; $sql = “SELECT COUNT(*) as total  FROM {$wpdb->comments} as c   JOIN {$wpdb->posts} as p ON p.ID = c.comment_post_ID  WHERE c.comment_approved = ‘1’  AND p.post_status=”publish”   AND … Read more

creating a second image attachment template?

attachment.php is not the only template file for attachment display. mime-type based template files get priority. MIME_type.php – it can be any MIME type (image.php, video.php, application.php). For text/plain, in order: text.php plain.php text_plain.php http://codex.wordpress.org/Template_Hierarchy#Attachment_display I expect that that is the issue you are seeing. Check your theme for image.php. There is a further problem … Read more