WordPress.org

Ready to get started?Download WordPress

Forums

[p2 theme] Hide comments home page only (15 posts)

  1. sudomagodo
    Member
    Posted 3 years ago #

    Hi guys,

    is it possible to hide the home page comments list only?
    If I choose "Hide comment threads by default" in options menu the theme hide the article page comments too.
    I need to hide exclusively the home page's comments.

    Please, help me, is my last step to the theme modding conclusion...

    [P2 THEME 1.2.3]

  2. kantell
    Member
    Posted 3 years ago #

    I was able to do so by putting the following around the comments area.

    <?php if (!is_home () ) : ?>

    <?php endif; ?>

  3. lucas_santos_jornalista
    Member
    Posted 3 years ago #

    Hi,

    How do you hide comments just at index.php or home page at p2 theme?

    I didnt understand it.

    Can you explain better which php file i need to change and which code i need to put to hide comments at home page (index.php) please?

    Ty

  4. rohitsharma33
    Member
    Posted 3 years ago #

    yes ofcourse you can hide your comments on home page.

    Go to admin->pages and click 'quick edit' below the home page menu them unheck the Allow Comments and save your page..

  5. lucas_santos_jornalista
    Member
    Posted 3 years ago #

    I´m asking about how do you hide comments just at index.php or home page at p2 theme?

    about "Go to admin->pages and click 'quick edit' below the home page menu them unheck the Allow Comments and save your page..", it doesn´t work!

    I need changes inside p2 theme (php files) please!

  6. kantell
    Member
    Posted 3 years ago #

    <?php if (!is_home () ) : ?>
    <?php
    include(TEMPLATEPATH . '/comments.php'); // Display comments
    ?>
    <?php endif; ?>

  7. lucas_santos_jornalista
    Member
    Posted 3 years ago #

    hi, kantell,

    i wanna hide the comments just at index.php page (home page)

    which file do i need to put the code?

    and which code to HIDE not display the comments, please?

    i dont understant php, so i need just copy/paste the right code

    thanks for attention

  8. kantell
    Member
    Posted 3 years ago #

    You put this in the index file. Basically, this code says that if the page is NOT the home page, then show comments. Otherwise, hide them. Put it in place of the comments line that is currently on the index page.

  9. lucas_santos_jornalista
    Member
    Posted 3 years ago #

    Hi, Kantell, my index.php s that one bellow it. I´ve tried to use your code but this one You put here is not working for me.

    Where do I put this one in index.php?!

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Where do I put the code in the index.php file?

    Thank you!

  10. kantell
    Member
    Posted 3 years ago #

    First off, you have errors in your code. Remove ">RSS anywhere it appears.

    Second, I don't see a call to comments.php. What is the URL?

  11. lucas_santos_jornalista
    Member
    Posted 3 years ago #

    Hi, Kantell.

    I use the original P2 theme, its the same!

    Could You put the right code based on the original index.php file of P2 theme with the code that hide comments just at home page, please?!

    ( i use the original theme)

    thanks again!

  12. tiaurus
    Member
    Posted 3 years ago #

    I use in js.php in line 166:

    <?php if ( (int) $hide_threads ) : ?>
    			  <?php if ( is_single() ) : ?>
    			    showComments();
    			  <?php else : ?>
    				hideComments();
    			  <?php endif; ?>
    			<?php endif; ?>
  13. daivu
    Member
    Posted 2 years ago #

    how to hide comment in archive page.. in p2 theme....?

    and can be do comment box is up into all listed comment?

  14. adam_smith
    Member
    Posted 2 years ago #

    Can anyone please attach some photos? I am a beginner and i need it. Thanks for the post.

  15. daivu
    Member
    Posted 2 years ago #

    where is post edit the code?? which page??? in p2 theme

    i want to edit post query i want to show post who have open comment.... in home page??? how these possible??

Topic Closed

This topic has been closed to new replies.

About this Topic