Enter your keyword

How To Selectively Suppress A Custom Section In Thesis

How To Selectively Suppress A Custom Section In Thesis


A while back, I posted a few tutorials for creating your own comment links in the Thesis Theme for WordPress. Some people have since asked how to selectively suppress this function; ie how can we get it to appear on posts only and not all pages. While there is a means of altering the code in order to tell it exactly when to appear and when not to appear, the easiest and quickest way to get it to stop showing up where you don’t want it is to create a custom CSS class to do so. Read below to learn how to do it.

  1. Create a custom CSS class. First, we’re going to create a custom CSS class called “noafterpost” by pasting the following code into the custom.css file:

    .noafterpost div.afterpost {
    display:none;
    }

    This class will be used to designate pages in which we do not want the comment function to appear.

  2. Add the custom class designation to pages where you do not want the function to appear.Now, we’re going to go to the offending pages that have comment links where they’re not wanted, such as my “About” page (above).

    We’re going to edit the page, and scroll down to the section that says “Custom CSS Class.” There, enter “noafterpost” and update the post.

  3. Confirm that the comment section has been removed. Your comment section should now be missing from the page you added to the “noafterpost” CSS class. Any other pages that need this can be updated in a similar way, and when you create a new page that you don’t want comments to appear on, just add the CSS Class while you’re creating the page. Also, if there’s some other function you’d like to suppress selectively, you can create custom CSS classes and alter the above code to use it in a similar way.

No Comments

Post a Comment

Your email address will not be published.