Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   How to remove Posted On/Posted By on Wordpress posts? (https://www.warriorforum.com/programming/445802-how-remove-posted-posted-wordpress-posts.html)

CarrieD 5th September 2011 01:33 PM

How to remove Posted On/Posted By on Wordpress posts?
 
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

KyleGolemMedia 5th September 2011 03:26 PM

Re: How to remove Posted On/Posted By on Wordpress posts?
 
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!

CarrieD 5th September 2011 04:59 PM

Re: How to remove Posted On/Posted By on Wordpress posts?
 
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!

Tim Brownlaw 5th September 2011 06:59 PM

Re: How to remove Posted On/Posted By on Wordpress posts?
 
Quote:

Originally Posted by CarrieD (Post 4616317)
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

CarrieD 5th September 2011 07:45 PM

Re: How to remove Posted On/Posted By on Wordpress posts?
 
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');

Quote:

Originally Posted by Tim Brownlaw (Post 4616870)
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


Tim Brownlaw 5th September 2011 08:29 PM

Re: How to remove Posted On/Posted By on Wordpress posts?
 
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_url( get_the_author_meta( 'ID' ) ),
    
sprintf( esc_attr__( 'View all posts by %s', 'portfoliopress' ), get_the_author() ),
    
get_the_author()
    );
    
?>
    </div><!-- .entry-meta -->

Cheers
Tim

stevemack 6th September 2011 03:21 AM

Re: How to remove Posted On/Posted By on Wordpress posts?
 
Try deleting <?php the_time('F jS, Y') ?> from your single.php and index.php.

CarrieD 6th September 2011 11:10 AM

Re: How to remove Posted On/Posted By on Wordpress posts?
 
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

Quote:

Originally Posted by Tim Brownlaw (Post 4617254)
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_url( get_the_author_meta( 'ID' ) ),
    
sprintf( esc_attr__( 'View all posts by %s', 'portfoliopress' ), get_the_author() ),
    
get_the_author()
    );
    
?>
    </div><!-- .entry-meta -->

Cheers
Tim


CarrieD 6th September 2011 11:16 AM

Re: How to remove Posted On/Posted By on Wordpress posts?
 
Quote:

Originally Posted by stevemack (Post 4619012)
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(); ?>

Tim Brownlaw 8th September 2011 02:49 AM

Re: How to remove Posted On/Posted By on Wordpress posts?
 
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


All times are GMT -6. The time now is 12:04 PM.