query_posts, oderby meta_value & print “future” posts

I would suggest storing the date-times as either: Timestamp (to sort/compare by meta_value_num) ‘yyyy-mm-dd hh:mm (e.g. 2012-04-11 19:37) to sort/compare by meta_value Then the following will work (assuming you’re using timestamp): $now = current_time(‘timestamp’); $args = array( ‘post_type’ => ‘rides’, ‘posts_per_page’ => 3, ‘meta_query’ => array( array( ‘key’ => ‘date’, ‘value’ => $now, ‘compare’ => … Read more

Add text to metabox input text field from Thickbox

What your code in; jQuery(document).ready(function(){ // your code here… }); …and in fact your code should look like this; jQuery(document).ready(function($){ $(‘.insertdownload’).click(function(){ var did = ‘this is only a test’; did=did.replace(‘download-‘, ”); if ($(‘#format’).val(‘1’)) { $(‘#my_new_field’).val(‘[download id=”‘ + did + ‘” format=”‘ + $(‘#format’).val() + ‘”]’); } else { $(‘#my_new_field’).val(‘[download id=”‘ + did + ‘”]’); } … Read more

Using is_plugin_active within functions.php

How about this? function useragent_shortcode($tag) { include_once( ABSPATH . ‘wp-admin/includes/plugin.php’ ); if ( is_plugin_active(‘contact-form-7/wp-contact-form-7.php’) ) { if ( ! is_array( $tag ) ) return ”; $options = (array) $tag[‘options’]; foreach ( $options as $option ) { if ( preg_match( ‘%^name:([-0-9a-zA-Z_]+)$%’, $option, $matches ) ){ $name_att = $matches[1]; } $userAGENT .= $_SERVER[‘HTTP_USER_AGENT’]; } $user_agent = $userAGENT; … Read more

Why might a comment turn red on approval?

Got it figured, so I’m closing this question out. Here was the problem: on comment approval, I had some custom stuff hooked, and this custom stuff was throwing an error. This error was being included as part of the comment approval’s AJAX response. It turs out that on listings pages in the admin, if WordPress … Read more

custom field output after the_content

This is the answer – code to be added in the functions.php: add_filter( ‘the_content’, ‘my_the_content_filter’, 0 ); function my_the_content_filter( $content ) { if ( is_single() ) { global $post; $pgLnk=get_post_meta($post->ID, ‘Button’, true); $content .= ‘<div id=”button-link”><a href=”‘.$pgLnk.'” target=”_blank”> <span class=”button-link”></span></a></div>’; } return $content; } This code was wrote by @Sheikh Heera on stackoverflow.com – direct … Read more