I created a shortcode that works, but the color only shows on first paragraph (1 post)

  1. HorrorUK
    Posted 3 years ago #

    Hi all,

    I thought I'd have a go at creating some shortcodes to make life a little easier. The idea of this one is to create a a nice curved area which is darker than the background with a lighter text.

    For some reason, everything seems to work ok on it, I get the full curved area between the shortcode, which is [dark1] and [/dark1] but the text only changes color on the first paragraph, as you can see here:


    The code used was this:


    function dark1( $atts, $content = null ) {
    	return '<div class="sc-dark1">"'.$content.'"</div>';
    add_shortcode("dark1", "dark1");


    .sc-dark1 {
    background: #575970;
    color: #afb0bc;
    padding: 10px;
    border-radius: 20px;

    I can't figure out what I may have done wrong, so any help is very much appreciated (especially as this is my wife's site).


Topic Closed

This topic has been closed to new replies.

About this Topic