I'm aware of the opotion to drive PHP to exclude/include contents using is_single & is_home functions.
But I need to know if is there a way to include/hide contents from being displayed, using some tag techniques in the post editor, say a particular tag enclosing to hide some contents in index.php
Any idea?
IIRC, the "HTML" mode will generally respect <element style="">, so you could write some CSS that describes a hidden element. You might also try the HTML comment tags.
Ok but what if I need to hide something in index.php and show it in single.php?
example:
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi quam. Ut ullamcorper ornare nunc. <strong>*show-a-link-on-single.php-but-not-on-index.php*</strong> Nam cursus, felis sit amet posuere fermentum, erat odio pretium lacus, at mattis augue lectus et purus. Praesent eleifend ullamcorper urna. Aenean orci diam, pretium eget, consequat eget, accumsan ut, nibh.<p>
Ok this is what I've done:
- created some html comments/tags in the post
- modified an existing plugin that sticks a filter to the_content() and coded a conditional is_home() formatting.
It works.