Support » Themes and Templates » How to modify the default caption layout

  • Hello, I use Twenty Eleven theme and I would like to change the default caption layout.
    For now, I’ve succeed to ignore the dash character which appear next to the caption thanks to css :

    .wp-caption .wp-caption-text:before {
    	content: '';
    }

    But I would like to use
    blockquote tag instead of <p>.
    Any help would be much appreciated!

    [Please post markup snippets between backticks or use the code button.]

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi

    (@esmi)

    Forum Moderator

    Do not edit the Twenty Eleven theme. It is the default WordPress theme and having access to an unedited version of the theme is vital when dealing with a range of site issues. Create a child theme for your changes.

    Michael

    (@alchymyth)

    Forum Moderator

    you need to re-write the caption shortcode (new code added to functions.php of your theme or in a plugin) to do that.

    what is the purpose ?

    you could emulate the look of a blockquote by adding new css to style.css of your child theme.

    Yes but I have styled blockquote tag and I would like to use that style!
    So instead of using p tag, I think it would be easier to use blokcquote tag instead of style p tag in caption.
    I dont find caption shotcode. Where is it?

    Michael

    (@alchymyth)

    Forum Moderator

    it is way more complicated to re-write the caption code than to restyle the paragraph within .wp-caption-text p to look like your blockquote. (full stop)

    the caption code is in /wp-includes/media.php from line707;

    do not edit wp core files.

    Can I copy the same function in my child theme function file ?
    I mean, using a function that will don’t take care of the function in the core files but will take care of the function in the child theme file?

    I hope I was clear…

    Michael

    (@alchymyth)

    Forum Moderator

    try to add this to functions.php of your child theme:

    http://pastebin.com/9LHkqG8L

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to modify the default caption layout’ is closed to new replies.