WordPress.org

Ready to get started?Download WordPress

Forums

[closed] Caption broken in new 3.4 posts (43 posts)

  1. Gouri
    Member
    Posted 2 years ago #

    Check whether there is any update for your theme after WP 3.4 release. Most of the themes have solved this issue through minor update.

  2. dmgphotography
    Member
    Posted 2 years ago #

    andidas thank you so much for chasing this down and providing a very clear fix.

  3. sbremen
    Member
    Posted 1 year ago #

    @Andrew Nacin, you asked for specific plug-ins which seemed to break the new caption code. When I deactivated this Pinterest plug-in, my captions began working again:
    http://wordpresspinterestplugin.com/

    I'm using Site5's WordPress Anniversary Theme (http://makeandshowandtell.com/).

  4. howdeck
    Member
    Posted 1 year ago #

    For those who say Thesis has issued a patch or fix for this - is it something I need to hunt down? I'm showing no Thesis updates available, yet I'm still having the problem. Captions do not appear in a frame around the image, they appear off to the right, in the same font as the the paragraph, and the image is not framed. For me, it also occurred after the WordPress update everyone has referenced, but it also went back and changed previously published posts, not just new ones going forward. Very frustrating. Any help would be greatly appreciated!

    http://underscoopfire.com/1983-jc-penney-catalog/
    (scroll to the Minka Kelly and Skeletor images - the sentence NEXT to the pic is supposed to be the caption)

  5. howdeck
    Member
    Posted 1 year ago #

    OK, so the links I provided above are now bad examples because I used the manual fix from earlier in this thread to correct the images in that post. But PLEASE tell me there is a fix that will allow me to not have to go in to all 300+ posts on my site and fix the captions.

  6. Jay Versluis
    Member
    Posted 1 year ago #

    @howdeck

    You need to install Thesis 1.8.5 or later for this problem to get fixed. Thesis does not automatically tell you that an update is available, nor does it apply them via one-click like other themes that are hosted on WordPress.org. Head over to DIYthemes.com and follow the instructions to upgrade.

    My site is running Thesis 1.8.5, here's a link with working captions:

    http://wpguru.co.uk/2012/04/new-features-in-p2-140/

  7. nicknormal
    Member
    Posted 1 year ago #

    I have de/activated each of my plugins one by one, and doing so does not resolve the caption conflict - captions are still being rendered incorrectly, with all the plugins deactivated.

    I have also (with plugins deactivated) implemented the functions hook provided by andidas here, and still the captions are not displaying correctly.

    I use a completely custom-theme, hand-coded, so any advice on correcting this WordPress 3.4+ implementation is appreciated. Thanks.

  8. Daniel
    Member
    Posted 1 year ago #

    In my completely custom-theme, hand-coded, I removed this code in the functions.php:

    /**
     * The TwentyTen Five Caption shortcode.
     * added by Richard Shepherd to include HTML5 goodness
     *
     * The supported attributes for the shortcode are 'id', 'align', 'width', and
     * 'caption'.
     *
     * @since TwentyTen Five 1.0
     */
    
    add_shortcode('wp_caption', 'twentyten_img_caption_shortcode');
    add_shortcode('caption', 'twentyten_img_caption_shortcode');
    
    /**
     * Prints HTML with meta information for the current post—date/time and author.
     *
     * @since TwentyTen Five 1.0
     */
    function twentyten_img_caption_shortcode($attr, $content = null) {
    
    	extract(shortcode_atts(array(
    		'id'	=> '',
    		'align'	=> 'alignnone',
    		'width'	=> '',
    		'caption' => ''
    	), $attr));
    
    	if ( 1 > (int) $width || empty($caption) )
    		return $content;
    
    if ( $id ) $idtag = 'id="' . esc_attr($id) . '" ';
    $align = 'class="' . esc_attr($align) . '" ';
    
      return '<figure ' . $idtag . $align . 'aria-describedby="figcaption_' . $id . '" style="width: ' . (10 + (int) $width) . 'px">'
      . do_shortcode( $content ) . '<figcaption id="figcaption_' . $id . '">' . $caption . '</figcaption></figure>';
    }

    .. and now the caption works fine again! Thanks to Andrew Nacin for the right tip!

  9. inhouse
    Member
    Posted 1 year ago #

    I am using a custom built theme and did not have ANY caption shortcode in my theme's functions file. I found another thread on this issue that helped. I added this to my functions and it's working properly now.

    add_shortcode( 'wp_caption', '' );
    add_shortcode( 'caption', '' );

    I'm not sure why this function is now required when it wasn't before but as long as it's working, I'm ok with it.

  10. Dave333
    Member
    Posted 1 year ago #

    I don't have any shortcode in my functions.php file either. I tried adding this one inhouse gave but still can't get captions working. Is there something I need to wrap these two lines of code with? Does the code have to be added at the top of the bottom of the functions.php file?

  11. lporterrn
    Member
    Posted 1 year ago #

    I have not been able to add a caption into my photos for months. The caption appears to be there but when I preview or publish the post. Reading these comments about codes is like reading Greek. Can anyone help me?

  12. inhouse
    Member
    Posted 1 year ago #

    @Dave333, you can place the code anywhere in your functions file but I'd recommend placing it right before the closing ?> that way you ensure you're not interfering with any other functions.

    @lporterrn We'd need to see what the caption code looks like in the HTML tab of your page editor for a sample post and then a link to view the published post in order to help you further. Have you tried adding the function to your theme's functions.php file?

  13. esmi
    Forum Moderator
    Posted 1 year ago #

    As per the Forum Welcome, please post your own topic. Posting in an existing topic prevents us from being able to track issues by topic. Added to which, your problem - despite any similarity in symptoms - is likely to be completely different.

    Closing topic.

Topic Closed

This topic has been closed to new replies.

About this Topic