Forums

[resolved] Hide some post contents from index.php,without using PHP (4 posts)

  1. Blutarsky
    Member
    Posted 3 years ago #

    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?

  2. brainycat
    Member
    Posted 3 years ago #

    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.

  3. Blutarsky
    Member
    Posted 3 years ago #

    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>

  4. Blutarsky
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags