• Hi,
    I’ve been looking at this tutorial http://tutorials.mysitemyway.com/adding-column-layout-shortcodes-to-a-wordpress-theme/ to find out how to add columns to my theme using a short code. The method used on that tutorial is relatively simple, and just adds <divs> around the block of text with set percentage widths and a float.

    This works fine for the single.php, but my index.php uses excerpts which doesn’t work. When I look at the source the code doesn’t show at all for the post content, it’s just empty. Is there a filter on the_excerpt() that catches divs and stops them being displayed? I’m at a loss here!

    Thanks in advance for your help.

Viewing 1 replies (of 1 total)
  • Thread Starter CodeBotics

    (@codebotics)

    Okay, I just saw this: http://wordpress.org/support/topic/stripping-out-html-from-ltphp-the_excerpt-help?replies=2, so yes the_excerpt does strip out html.

    How can I fix this? Is it possible to stop it stripping out divs, and then add a closing </div> if it shortens the excerpt?

    I think I can add the closing </div> by using this:
    return '</div><p id="readmore"><a href="'. get_permalink($post->ID) .'">Read More</a></p>';
    instead of this:
    return '<p id="readmore"><a href="'. get_permalink($post->ID) .'">Read More</a></p>';

    But I’m not sure how to stop div tags being stripped!

Viewing 1 replies (of 1 total)
  • The topic ‘Column Layout using Excerpt’ is closed to new replies.