Removing Extra Caption tag around image on post of WordPress

To make sure the shortcode executes, save the content to a variable, then run do_shortcode on the saved variable. <div class=”thecontent” itemprop=”articleBody”> <?php $content = get_the_content(); echo do_shortcode($content); ?> </div> The difference is, echoing just literally echoes whatever has been grabbed. PHP’s built-in functions don’t have any special way to process shortcodes so they just … Read more

wp_mail sending old content from post

There’s a few things you need to do here, you need to modify your add_action() to accept additional arguments and you need to specify whether to use the data before the update or the data after the update. Try something like this: function send_media_emails($post_id, $post_after){ if(defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return; if(get_post_status($post_id) == ‘draft’ or get_post_status($post_id) == … Read more

WordPress: Loop Help

You’re using query_posts() for your featured-post custom loop. As the Codex says: don’t do that. The query_posts() function is intended to modify the Primary Loop. If you need a custom loop, use e.g. $my_custom_query = new WP_Query( $args ). See here for a good break-down of custom-loop options.

Show image exactly defined to a width

If $content_width is the problem, you could set it to something different if you’re viewing a single HQ post. function wpse99587_single_hq_post() { global $post; if( is_single() && in_category( ‘HQ’, $post->ID ) ){ global $content_width; $content_width = 900; } } add_action( ‘wp’, ‘wpse99587_single_hq_post’ ); // I dithered on where to hook this function; // if there’s … Read more

Creating a post from data returned from HTML form

I worked it out and re-wrote the code: jQuery(document).ready(function() { jQuery(‘#createacostume’).submit(function( event ) { event.preventDefault(); var aForm = jQuery(this); var bForm = aForm.serializeArray(); bForm.push({name: ‘action’, value: ‘myAjaxFunction’}); jQuery.ajax({ url: ajaxurl, type: “POST”, data: bForm, success: function(resp) { alert(“Thank you for your post. We will review it and approve it shortly” + resp); }, error: function( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)