How to remove Posted On/Posted By on Wordpress posts?

9 replies
How do I remove "Posted On" and "Posted By" on my Wordpress posts? I am using WP Portfolio Press theme and have managed to mangle this. Can someone please give me some advice? Here is what I have so far: Reunion Info | Valley High School Class of 1986

Thanks,
C
#on or posted #posts #remove #wordpress
  • Profile picture of the author KyleGolemMedia
    There's a fair chance you need to dive into comments.php. Within that, you'll know that "Posted On" and "Posted By" will be written in HTML. Hunt them down and delete them. Make sure you remove the opening and closing PHP as well.

    Hope that helps!
    Signature
    Need Help Growing Your Audience?
    Let an experienced Marketer help! PM me with project details.
    Google AdWords, Bing Ads, Facebook Ads, Twitter Ads, etc.
    {{ DiscussionBoard.errors[4615806].message }}
  • Profile picture of the author CarrieD
    Thanks for trying to help me but "Posted On" and "Posted By" doesn't exist in the comments.php file on this theme. I'm still stuck so if you or anyone else can think of another option I'm all ears!
    {{ DiscussionBoard.errors[4616317].message }}
    • Profile picture of the author Tim Brownlaw
      Originally Posted by CarrieD View Post

      Thanks for trying to help me but "Posted On" and "Posted By" doesn't exist in the comments.php file on this theme. I'm still stuck so if you or anyone else can think of another option I'm all ears!
      Hi Carrie,

      Ready for some hunting of waskily chunks of generated HTML?

      Just as some guidance on this... in the WP twentyten theme it has a function called twentyten_posted_on.... that has all that guff in it. That's in the the themes function.php file

      So take a look in your themes function file... It might it in there.

      If you have the WP files local on your PC you can do a search for the term "posted on" and it will reveal all!

      Once you do find the function - if there is one... you can search through the other files and just comment out / remove the call to it...

      If that's still all confusing and the theme you are using is freely available, let us know and I can hunt it down for you.... But it's good fun if you have a go at it first!

      Cheers
      Tim
      {{ DiscussionBoard.errors[4616870].message }}
      • Profile picture of the author CarrieD
        Hi Tim, thanks for the reply. The theme that I am using is Portfolio Press and I looked on function.php and didn't find "posted on".

        But, I pasted the following to the top of function.php and it excluded the date. I found this info online somewhere. I don't know if that is helpful to you.

        function jl_remove_post_dates() {
        add_filter('the_date', '__return_false');
        add_filter('the_time', '__return_false');
        add_filter('the_modified_date', '__return_false');
        add_filter('get_the_date', '__return_false');
        add_filter('get_the_time', '__return_false');
        add_filter('get_the_modified_date', '__return_false');
        } add_action('loop_start', 'jl_remove_post_dates');

        Originally Posted by Tim Brownlaw View Post

        Hi Carrie,

        Ready for some hunting of waskily chunks of generated HTML?

        Just as some guidance on this... in the WP twentyten theme it has a function called twentyten_posted_on.... that has all that guff in it. That's in the the themes function.php file

        So take a look in your themes function file... It might it in there.

        If you have the WP files local on your PC you can do a search for the term "posted on" and it will reveal all!

        Once you do find the function - if there is one... you can search through the other files and just comment out / remove the call to it...

        If that's still all confusing and the theme you are using is freely available, let us know and I can hunt it down for you.... But it's good fun if you have a go at it first!

        Cheers
        Tim
        {{ DiscussionBoard.errors[4617063].message }}
        • Profile picture of the author Tim Brownlaw
          Hi Carrie,

          I had a look and found the following...

          There are 3 files in total where this little bit happens.

          Line 15 to 26 in loop.php
          Line 18 to 29 in single.php
          Line 18 to 29 in single-portfolio.php

          So you can edit these files via your WP Admin - and look for this section ( as mentioned above ) and delete them

          PHP Code:
          <div class="entry-meta">
            <?php
              printf
          __'<span class="meta-prep meta-prep-author">Posted on </span><a href="%1" rel="bookmark"><time class="entry-date" datetime="%2" pubdate>%3</time></a> <span class="meta-sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4" title="%5">%6</a></span>''portfoliopress' ),
              
          get_permalink(),
              
          get_the_date'c' ),
              
          get_the_date(),
              
          get_author_posts_urlget_the_author_meta'ID' ) ),
              
          sprintfesc_attr__'View all posts by %s''portfoliopress' ), get_the_author() ),
              
          get_the_author()
              );
              
          ?>
              </div><!-- .entry-meta -->
          Cheers
          Tim
          {{ DiscussionBoard.errors[4617254].message }}
          • Profile picture of the author CarrieD
            Hi Tim, I appreciate your help. I made the edit that you gave me but got this when I tried to view the pages:
            Parse error: syntax error, unexpected ',', expecting ')' in /home/mokeymoke/valleyhigh1986.com/wp-content/themes/portfolio-press/single-portfolio.php on line 25

            Originally Posted by Tim Brownlaw View Post

            Hi Carrie,

            I had a look and found the following...

            There are 3 files in total where this little bit happens.

            Line 15 to 26 in loop.php
            Line 18 to 29 in single.php
            Line 18 to 29 in single-portfolio.php

            So you can edit these files via your WP Admin - and look for this section ( as mentioned above ) and delete them

            PHP Code:
            <div class="entry-meta">
              <?php
                printf
            __'<span class="meta-prep meta-prep-author">Posted on </span><a href="%1" rel="bookmark"><time class="entry-date" datetime="%2" pubdate>%3</time></a> <span class="meta-sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4" title="%5">%6</a></span>''portfoliopress' ),
                
            get_permalink(),
                
            get_the_date'c' ),
                
            get_the_date(),
                
            get_author_posts_urlget_the_author_meta'ID' ) ),
                
            sprintfesc_attr__'View all posts by %s''portfoliopress' ), get_the_author() ),
                
            get_the_author()
                );
                
            ?>
                </div><!-- .entry-meta -->
            Cheers
            Tim
            {{ DiscussionBoard.errors[4621535].message }}
  • Profile picture of the author stevemack
    Try deleting <?php the_time('F jS, Y') ?> from your single.php and index.php.
    {{ DiscussionBoard.errors[4619012].message }}
    • Profile picture of the author CarrieD
      Originally Posted by stevemack View Post

      Try deleting <?php the_time('F jS, Y') ?> from your single.php and index.php.
      Hi Steve,
      Index.php and single.php doesn't have that info. Copied below is what is in the index.php and I did a search on single.php to make sure that it doesn't have that info.

      <?php
      /**
      * @package WordPress
      * @subpackage Portfolio Press
      */
      ?>

      <?php get_header(); ?>

      <div id="content">

      <?php get_template_part( 'loop', 'index' ); ?>

      </div><!-- #content -->

      <?php get_sidebar(); ?>
      <?php get_footer(); ?>
      {{ DiscussionBoard.errors[4621575].message }}
      • Profile picture of the author Tim Brownlaw
        Hi Carrie,

        I just tried it again and it "works for me"!
        Make sure you delete that actual chunk of code from and including

        <div class="entry-meta">
        --- The rest of the code in my previous post ---
        </div><!-- .entry-meta -->


        You are removing a chunk of PHP wrapped in HTML. So if you are getting PHP errors you must not be removing the complete section I mentioned and just a part of it.

        You might want to try again.
        Don't go off the line numbers as such, they may appear differently for you.

        Cheers
        Tim
        {{ DiscussionBoard.errors[4634264].message }}

Trending Topics