Removing "Posted by etc." from Pages (2 posts)

  1. DArt84
    Posted 5 years ago #

    Hi all,

    I'm using SimpleDark theme, and as mentioned in the title, I'd like to remove the meta infos (author, date, categories) that are just below the page title, and I'd like to remove it from pages only.
    I've been figuring out that the following part must be the key for managing that, but I'm not able to proceed any further, since I'm not an expert in PHP at all.
    <div class="post-meta"><?php the_time(simpledark_time_format('date')); ?> / <?php if(!is_page()) { the_author_posts_link(); _e(' posted in ', THEME_NAME); the_category(', '); } else { printf(__('Posted by %s', THEME_NAME), simpledark_get_the_author_posts_link()); } ?> / <?php if(function_exists('the_views')) { the_views(); echo ' / '; } if(post_password_required()) { _e('X Comments', THEME_NAME); } else { comments_popup_link(__('No Comments', THEME_NAME), __('1 Comment', THEME_NAME), __('% Comments', THEME_NAME), 'comment-link', __('Comments Off', THEME_NAME)); } edit_post_link(__('Edit', THEME_NAME), ' / '); ?></div>

    I've tried to edit the first function like this, but nothing relevant happened (as I told you, I'm not a PHP coder at all):
    <?php if(!is_page()) { return false; } else { printf(__('Posted by %s', THEME_NAME), simpledark_get_the_author_posts_link()); } ?>

    Any suggestions?
    Thanks in advance.

  2. DArt84
    Posted 5 years ago #

    There's one thing I've forgot.
    All the code is written within a file named singular.php, that is recalled in both single.php and page.php via this string:
    <?php include(SIMPLEDARK_TEMPLATES . '/singular.php'); ?>
    Would it be a good idea to delete this string in the page.php and copy all the code in it from singular.php and make my editings?

Topic Closed

This topic has been closed to new replies.

About this Topic