Web Design Blog

This is where we store some of our Web Development thoughts, tips and tricks, just because we like to share.

WordPress Excerpt Function Showing CSS #gallery-1

I had the strangest problem earlier. A client had reported that CSS code was showing on a category page, where only excerpts of a post should be showing. This is what it looked like:

Wordpress Excerpt Function Showing CSS

To cut a long story short, this issue was driving me insane, and I was frantically trying to pin down the cause of the problem. I eventually tracked down the culprit. It was the Events Calender plugin.

If you’ve installed the Events Calender plugin, and you’re experiencing the CSS bug, continue reading, I have a solution for you. If you’re experiencing this problem but DON’T have the plugin installed, I probably don’t have a solution for you. But the root of the problem maybe of a similar nature, as in a plugin you have installed is causing the issue.

The solution for those that have the Events Calender plugin installed

Step 1: Find the file eventcalandar3.php, located in /wp-content/plugins/event-calandar/.

Step 2: Find the following function, ec3_get_the_excerpt.

Step 3:
Replace:

1
$text=strip_tags($text);

With:

1
$text=strip_tags($text, '<style>');

Step 4:
Upload the new eventcalandar3.php file. I would suggest keeping a backup of the original file.

That should have resolved the problem. Phhheeeeew!

Please let me know if this helped anyone. I’m curious to know if this issue has plagued anyone else!

05 Apr 2011 / 2 Comments / Wordpress / by Maruf

2 Comments

  1. 25/06/2011
    1

    thanks a lot.
    problem is solved :)

  2. jberg1
    30/06/2011
    2

    You ‘da man!!!. Thanks for this, worked like a charm.

    That Event Calendar Plugin is nice, but a bit squirrely.

Leave a Reply

© 2012 BrightCherry :)