Trying to create a grid/column shortcode (2 posts)

  1. clestcruz
    Posted 2 years ago #

    I have been going back and forth, doing a lot of trial and error. What i want to output is a grid/column shortcodes.

    For example [column_one]Lorem Ipsum[/column_one]

    so far this is what i have came up

    /*Grid Shortcode*/
    function grid_one($content = null) {
        return '<div class="one columns">'.$content.'</div>';
    add_shortcode('column_one', 'grid_one' );

    when try to apply the opening and closing shortcode. My text seems to disappear. I'm using skeleton framework and my CSS for that stylesheet is located in this folder called "CSS".


    When i tried to create a clearfix shortcode. It seems to be working fine with no problems and it clears the floated elements. Here is the code.

    //Clear Shortcode
    function clear_fix($content = null) {
        return '<div class="clearfix"></div>';
    add_shortcode ('clear', 'clear_fix');
  2. clestcruz
    Posted 2 years ago #

    Ok so i managed to solve my shortcode. Now i have another problem. The grid worked but the first paragraph doesn't have any styling but the 2nd and 3rd have styling http://i255.photobucket.com/albums/hh140/testament1234/font_zps75ea6335.png

Topic Closed

This topic has been closed to new replies.

About this Topic