rwilki
Member
Posted 8 months ago #
Wish I designed the site recently and not a few years ago. The site has a ton of hard coded html tables with some inline css styles embedded. Using a plugin for mobile theme it doesn't like the html tables and the content runs off the page. Wptouch has great shortcodes but it will kill me to add the shortcode before and after every table, td, tr, tags.
I tried the php to strip html tags and would like to replace them with echo <p> or
<div>.
This is what I'm using:
<div class="<?php wptouch_content_classes(); ?>">
<?php wptouch_the_content();
echo strip_tags('<p>'); ?>
</div>
Is this possible?
pdclark
Member
Posted 8 months ago #
Yes. Add a filter to the_content conditionally when WP Touch is loaded.
rwilki
Member
Posted 8 months ago #
thanks pdclark... don't even know where to begin
pdclark
Member
Posted 8 months ago #
A literal interpretation of what you're describing would go something like this in PHP:
[Code moderated as per the Forum Rules. Please use the pastebin]
You would put that in functions.php. It has not been tested.
Alternatively (and much more simply), you could likely fix it with just CSS. Something like:
.entry-content {position:relative; display:block}
.entry-content table { width: 100% !important; }
pdclark
Member
Posted 8 months ago #
A literal interpretation of what you're describing would go something like this in PHP: http://pastebin.com/rGG3besF
rwilki
Member
Posted 8 months ago #
Wow. What a great concept using a filter in the functions file. I actually made it work with the table width set to 100% but it still looks a little clunky. I might try the filter. I'll let you know.
Thank you very much!!!
rwilki
Member
Posted 8 months ago #
Wow. What a great concept using a filter in the functions file. I actually made it work with the table width set to 100% but it still looks a little clunky. I might try the filter. I'll let you know.
Thank you very much!!!