WordPress.org

Ready to get started?Download WordPress

Forums

BlankSlate
[resolved] Remove PHP statement generating comment line at end of posts (5 posts)

  1. 1timothy412
    Member
    Posted 1 year ago #

    I just posted this on the "Hacks" forum, but I'm not sure if I posted it in the right place - so here it is again.

    I'm coding my own theme design using BlankSlate. I'm not super familiar with PHP, and so I'm having trouble removing a command that calls the comments line at the end of the post. Here's what the code looks like:

    <div class="entry-footer">
    <?php
    printf( __( 'This article was posted in %1$s%2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>. Follow comments with the <a href="%5$s" title="Comments RSS to %4$s" rel="alternate" type="application/rss+xml">RSS feed for this post</a>.', 'blankslate' ),
    get_the_category_list(', '),
    get_the_tag_list( __( ' and tagged ', 'blankslate' ), ', ', '' ),
    get_permalink(),
    the_title_attribute('echo=0'),
    get_post_comments_feed_link() );
    if ( comments_open() && pings_open() ) :
    printf( __( '<a class="comment-link" href="#respond" title="Post a Comment">Post a Comment</a> or leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'blankslate' ), get_trackback_url() );
    elseif ( !comments_open() && pings_open() ) :
    printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for post" rel="trackback">Trackback URL</a>.', 'blankslate' ), get_trackback_url() );
    elseif ( comments_open() && !pings_open() ) :
    _e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond" title="Post a Comment">Post a Comment</a>.', 'blankslate' );
    elseif ( !comments_open() && !pings_open() ) :
    _e( 'Both comments and trackbacks are closed.', 'blankslate' );
    endif;
    edit_post_link( __( 'Edit', 'blankslate' ), "\n\t\t\t\t\t<span class=\"edit-link\">", "</span>" );
    ?>
    </div>

    It puts out the following paragraph at the end of a single post: "This article was posted in Uncategorized. Bookmark the permalink. Follow comments with the RSS feed for this post.Both comments and trackbacks are closed. Edit"

    I would like to remove the part: "Follow comments with the RSS feed for this post.Both comments and trackbacks are closed."

    I have tried removing different parts of the PHP, but I get this message: Parse error: syntax error, unexpected T_STRING in /home/acltmnco/public_html/testing/wp-content/themes/blankslate/entry-footer-single.php on line -" (line number depends on what parts of code I delete).

    Can someone please tell me what part of the PHP code I need to remove to get rid of the comments/trackbacks message, without getting an error?

  2. Andrew
    Forum moderator
    Posted 1 year ago #

    First make sure you're using a Child Theme before you modify any file.

    Then take a copy of the file you want to modify and paste it into your Child Theme directory. You can then modify that file within your Child Theme.

  3. 1timothy412
    Member
    Posted 1 year ago #

    I understand the concept of Child Themes and have used them several times before, but I have specific reasons for not using one this time. That being said, what I need to know is what PHP code to remove without causing an error.

  4. TidyThemes
    Member
    Theme Author

    Posted 1 year ago #

    @Andrew - 90% of the time you'd be right about a child theme. However, the point of BlankSlate is for users to make their very own theme, not child theme onto "someone else'" theme. Have a look here:

    http://tidythemes.com/concept/

    @1timothy412 - There are a number of things you can do here. Essentially, it looks like you simply want to remove the whole thing.

    - You could simply delete the entire entry-footer-single.php file and remove the call to it in all files.

    - You could leave the file, but completely remove the code and blank it out.

    - You could comment it out with <!-- --> in case you might change your mind later.

    - And several other options.

    Feel free to post in the official forum in the future:

    http://tidythemes.com/forum/

    Thanks

  5. TidyThemes
    Member
    Theme Author

    Posted 1 year ago #

    Version 4.0 is here:

    http://wordpress.org/themes/download/blankslate.4.0.zip

    Let us know what you think here:

    http://tidythemes.com/tidythemes-sucks/

    Thanks, TidyThemes

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.