WordPress.org

Ready to get started?Download WordPress

Forums

[BUG] MEDIA Attachments WP2.8 (4 posts)

  1. chartinael
    Member
    Posted 5 years ago #

    Somehow Media-Attachments are an issue.

    '<p>
    [Shortcode]contents[shortcode]'
    the </p> gets lost and even if noticed and entered manually in the editor ... it gets eaten.

    '[Shortcode]contents[shortcode]

    [Shortcode]contents[shortcode]'
    Absolutely empty post comes up. All there in the editor, no post content online (Titel is there, tags, edit etc at the bottom too - but other than that ... empty

    Also, don't know why (no programmer here) but the alignright and alignleft attachments worked fine ... but the aligncenter did not.

    So here is my code and that works:
    in line 207 I added padding ... otherwise the text would end up directly on the image - issue especially on floating right images:

    $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" title="' . esc_attr($title).'" '.$hwstring.'class="'.$class.'" style="padding-left: 10px;" />';

    Line 597ff:

    return '<div ' . $id . 'class="' . $align . '" style="text-align:center;">'
    	. do_shortcode( $content ) . '<br /><span class="wp-caption-text" style="position:relative;width:'. $width . 'px;padding-left:10px; display:inline-block;text-align:left;"><small>' . $caption . '</small></span></div>';

    I am sure there is a more elegant way to solve this issue but know the Images get centered an I can align the caption underneath whereever I won't left right centered.

    Krissy

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    [Shortcode]contents[shortcode]

    Sorry... what shortcode are you referring to?

    the alignright and alignleft attachments worked fine ... but the aligncenter did not

    Sounds like a CSS issue. Either .aligncenter hasn't been declared in the theme stylesheet or it's being superseded by later, or more specific, CSS.

  3. chartinael
    Member
    Posted 5 years ago #

    caption shortcode ...

  4. chartinael
    Member
    Posted 5 years ago #

    an this is not a major issue as it has been worked around ... however somehow the html-tags after the caption shortcode get eaten up and cause the page to come up blank if there is a linebreak between images

Topic Closed

This topic has been closed to new replies.

About this Topic