• Resolved jonaco

    (@jonaco)


    Tried several related topics on this subject to no avail. Trying to make the website less blog-like. Have a few Pages and several Categories. I’d like to remove any stamps related to time, date, author, as well as all edit links from all posts in every category except for one, which will be my actual Blog.

    Ideally, if I am able to retain stamps for posts on the “Blog” category, that would be great, but if if I have to lose them from “Blog” in order to lose them from every other Category, then that takes preference.

    I’ve tried deleting what I thought were the most obvious lines of code in the Single Post (single.php) but nothing changes.

    https://www.blenderdude.com

Viewing 9 replies - 1 through 9 (of 9 total)
  • vtxyzzy

    (@vtxyzzy)

    If you are using a free theme, post a link to its download site so we can take a look at the code.

    If you are using a paid theme, contact the theme supplier.

    Also, a working link to your site might help.

    Thread Starter jonaco

    (@jonaco)

    Thank you. I put the “under construction” page back up when it appeared I wasn’t going to receive any responses. I guess I need to be more patient!

    I hope the following is what you are asking for as far as the download site is concerned – and, yes, it is a free theme:

    https://newwpthemes.com/downloads/?theme=adeli

    Also, a working link to my site-in-progress:

    https://www.blenderdude.com

    A big thank-you in advance to anyone who can help!

    vtxyzzy

    (@vtxyzzy)

    I hope that is what you want. You should probably test it by copying archive.php to category.php and making the change there first.

    OK – Backup your theme first. The line which shows the date,etc., looks like this (line 29 in archive.php):

    <div class="postdate"><img src="<?php bloginfo('template_url'); ?>/images/date.png" /> <?php the_time('F jS, Y') ?> <img src="<?php bloginfo('template_url'); ?>/images/user.png" /> <?php the_author() ?> <?php if (current_user_can('edit_post', $post->ID)) { ?> <img src="<?php bloginfo('template_url'); ?>/images/edit.png" /> <?php edit_post_link('Edit', '', ''); } ?></div>

    Change that to this, by testing for cat=22:

    <?php if ( !in_category(22) ) { ?>
         <div class="postdate"><img src="<?php bloginfo('template_url'); ?>/images/date.png" /> <?php the_time('F jS, Y') ?> <img src="<?php bloginfo('template_url'); ?>/images/user.png" /> <?php the_author() ?> <?php if (current_user_can('edit_post', $post->ID)) { ?> <img src="<?php bloginfo('template_url'); ?>/images/edit.png" /> <?php edit_post_link('Edit', '', ''); } ?></div>
    <?php } ?>

    Make similar changes in index.php (line 12), search.php (line 15), and single.php (line 10).

    Thread Starter jonaco

    (@jonaco)

    vtxyzzy,

    Thank you very much for your assistance. I’m afraid I’m simply too new to WP to understand fully what I’m to do. I changed the code but the date/author/edit stamp still appears in every category except the one I’ve labeled “Blog”. Perhaps that is category 22, but I don’t know.

    If this is what you intended, for only the “Blog” category to change, then it worked exactly as I wanted, but I’m unsure how to change it for the remaining categories.

    If I’m on the right track, and “Blog” is actually category 22, I would love to implement these changes for every catergory EXCEPT for “Blog.” But I don’t want to get ahead of myself.

    Again, thank you for the help.

    vtxyzzy

    (@vtxyzzy)

    You are correct. I got it backwards. Remove the exclamation point in the first line of code, just before in_category, and it will show the date/etc for ONLY Blog:

    <?php if ( !in_category(22) ) { ?>
         <div class="postdate"><img src="<?php bloginfo('template_url'); ?>/images/date.png" /> <?php the_time('F jS, Y') ?> <img src="<?php bloginfo('template_url'); ?>/images/user.png" /> <?php the_author() ?> <?php if (current_user_can('edit_post', $post->ID)) { ?> <img src="<?php bloginfo('template_url'); ?>/images/edit.png" /> <?php edit_post_link('Edit', '', ''); } ?></div>
    <?php } ?>
    Thread Starter jonaco

    (@jonaco)

    Worked like a charm. Thank you so much.

    vtxyzzy

    (@vtxyzzy)

    You are very welcome!

    I also want to remove the author & date from my site, but I have a theme installed that i paid for, and it seems a little harder to find the code and change it. Have any suggestions?

    https://neveroddoreven.tv/wordpress/

    Hello WP,
    I’ve literally just created a new site and like jonaco, I want to make my website less blog like. I’ve been trying to remove the ‘date of post’ and the category, etc from the post that was already there when I created the site. I have had no success. I actually wanted to delete the post entirely but it won’t allow me.
    I’m new to WP and I downloaded a free theme (twenty ten)

    https://www.goldensense.org

    I do have an older web address which doesn’t have the date of post, category, etc and doesn’t look like a blog site! https://www.leimmrama.com

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Removing date/author/edit link from posts in Categories’ is closed to new replies.