WordPress.org

Ready to get started?Download WordPress

Forums

Coraline
[resolved] Disable "Comments are closed" and "posted on" on posts (11 posts)

  1. psaverio
    Member
    Posted 1 year ago #

    I am using Coraline theme and as first line of the post I am getting the texts 'posted on and the date' and 'comments disabled'. The texr 'comments disabled' is repeated also at the end of the post. Is there any way to hide these texts?
    Thanks.

    example of the post in the site: http://parrocchiaroccasinibalda.it/benedizione-delle-famiglie-pasqua-2013/

  2. sinitita
    Member
    Posted 1 year ago #

    I have removed any kind of meta information on my site recently, except the "posted on". So my example is slightly different, but this should help you to know where to go:

    1. in comments.php
    delete the following lines:

    <?php else : // or, if we don't have comments:
    	/* If there are no comments and comments are closed,
    	* let's leave a little note, shall we?
    	* But only on posts! We don't really need the note on pages.
    	*/
    if ( ! comments_open() && ! is_page() ) :?>
    <p class="nocomments"><?php _e( ' Comments are closed.', 'coraline' ); ?></p>
    <?php endif; // end ! comments_open() ?>

    disables entry „Comments are closed.“ on bottom in single-view

    2. in single.php
    For the single-post view
    inside "entry-meta" you find:

    <?php coraline_posted_on(); coraline_posted_by(); ?>
    <span class="comments-link"><span class="meta-sep">|</span> <?php comments_popup_link( __( 'Leave a comment', 'coraline' ), __( '1 Comment', 'coraline' ), __( '% Comments', 'coraline' ) ); ?></span>

    Delete completely the <span> part to remove any comments-entries above the posts.
    In my case I deleted also coraline_posted_by(); in the first line to delete the author but leaving the date above the posts.

    inside "entry-info" delete also
    <?php coraline_posted_in(); ?>
    if you want to remove the categories below the post. In my case this removed also the "Bookmark Permalink" thing

    3. in loop.php
    This is if you want the changings also for the main page displaying your posts.
    In the section: (/* How to display posts in the Gallery category. */)
    inside "enty-meta":
    original code:

    <?php coraline_posted_on(); coraline_posted_by(); ?>
    delete: coraline_posted_by()

    --> This is my case deleting author but leaving the date above the post.
    inside "enty-info" delete the following lines:

    <span class="comments-link"><?php comments_popup_link( __( '→ Leave a comment', 'coraline' ), __( '→ 1 Comment', 'coraline' ), __( '→ % Comments', 'coraline' ) ); ?></span>

    --> deletes comments-entries below the posts

    and the same for the section: /* How to display posts in the asides category */
    inside "entry-info" delete the following lines:

    <p class="comments-link"><?php comments_popup_link( __( '→ Leave a comment', 'coraline' ), __( '→ 1 Comment', 'coraline' ), __( '→ % Comments', 'coraline' ) ); ?></p>

    In the section /* How to display all other posts. */
    Inside "entry-meta" you find this:

    <?php coraline_posted_on(); coraline_posted_by(); ?>
    <span class="comments-link"><span class="meta-sep">|</span> <?php comments_popup_link( __( 'Leave a comment', 'coraline' ), __( '1 Comment', 'coraline' ), __( '% Comments', 'coraline' ) ); ?></span>

    elete completely the <span> part to remove any comments-entries above the posts.
    In my case I deleted also coraline_posted_by(); in the first line to delete the author but leaving the date above the posts.

    Inside "entry-info" you find:

    <p class="comments-link"><?php comments_popup_link( __( '→ Leave a comment', 'coraline' ), __( '→ 1 Comment', 'coraline' ), __( '→ % Comments', 'coraline' ) ); ?></p>
    <?php if ( count( get_the_category() ) ) : ?>
    <p class="cat-links"><?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'coraline' ), 'entry-info-prep entry-info-prep-cat-links', get_the_category_list( ', ' ) ); ?></p>
    <?php endif; ?>

    I deleted all of it to get rid of all type of information (comments, categories, permalink) below the posts.

    If you want to check my site to see how this will look: http://www.fian-berlin.de

  3. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Per the above post, any changes to theme files should be made in a Child Theme - so that your changes are not overwritten and lost when the theme is updated - http://codex.wordpress.org/Child_Themes

  4. sinitita
    Member
    Posted 1 year ago #

    Yes sure! Using a child theme is a must. I admit, I work with a whole copy of the theme at the moment, but that ist not perfect as I will miss theme updates this way.

    I didn't stress on the child theme here, as i supposed that anybody adapting themes to his own needs takes care of this issue.

  5. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Your post is really nicely done and will be super helpful to people who are trying to do what you did - thanks for posting it! (I should have said that above :) ) But since a lot of people on these forums are new to WP and don't know about child themes - we just try to make sure they aren't unknowingly creating future problems for themselves!

  6. psaverio
    Member
    Posted 1 year ago #

    Thank you very much Sinitita - exactly what I was looking for! Very clear explanation and very helpful.

  7. sinitita
    Member
    Posted 1 year ago #

    You're welcome! Just take care deleting the code... as WPyogi explained.
    If you want to do it with a child theme it's more complicated as you have to overwrite the functions that I just deleted.

  8. psaverio
    Member
    Posted 1 year ago #

    Now I do not know if what I did is correct. I made a child theme (style.css) and then copied and pasted comments.php, loop.php and single.php from the parent directory and made the modifications in these files (eliminating the codes) as you suggested. The posts do not show any more 'comments closed', 'posted on' etc. - which is what I wanted. Did I follow your istructions rightly?

  9. sinitita
    Member
    Posted 1 year ago #

    Glad to hear this, seems everything is looking nicely on your site now.
    Great that it works with a child theme!

  10. psaverio
    Member
    Posted 1 year ago #

    Thanks a lot again.

  11. psaverio
    Member
    Posted 1 year ago #

    Blessings

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.