WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. HorrorUK
    Member
    Posted 1 year 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:

    http://sylv-jenkins.com/test-page

    The code used was this:

    functions.php

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

    CSS

    .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).

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic