How do I remove the following things from the TwentyTen template?
Posted on July 19, 2010 by admin
Posted in Uncategorized | Comments Off
Thank you.
How do I remove the following things from the TwentyTen template?
Posted on July 19, 2010 by admin
Posted in Uncategorized | Comments Off
Thank you.
I would like to remove the date and author of the post and also the posted in uncategorized/comments off. Thanks.
moserengineering,
Open the functions.php file and look for the following code. Just comment it out in case you want it later by using /* and */.
if ( ! function_exists( 'twentyten_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post—date/time and author.
*
* @since Twenty Ten 1.0
*/
function twentyten_posted_on() {
printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
'meta-prep meta-prep-author',
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
get_permalink(),
esc_attr( get_the_time() ),
get_the_date()
),
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
get_author_posts_url( get_the_author_meta( 'ID' ) ),
sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ),
get_the_author()
)
);
}
endif;Thanks, that worked to get rid of the date and author.
Now, how about getting rid of the Posted in Uncategorized | Comments Off part?
below this function you will see twentyten_posted_in() function. Edit this for Posted in Uncategorized | Comments Off part.
I found this and deleted it but it didn't seem to do anything? Is this the right thing?
if ( ! function_exists( 'twentyten_posted_in' ) ) :
/**
* Prints HTML with meta information for the current post (category, tags and permalink).
*
* @since Twenty Ten 1.0
*/
function twentyten_posted_in() {
// Retrieves tag list of current post, separated by commas.
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list ) {
$posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the permalink.', 'twentyten' );
} elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
$posted_in = __( 'This entry was posted in %1$s. Bookmark the permalink.', 'twentyten' );
} else {
$posted_in = __( 'Bookmark the permalink.', 'twentyten' );
}
// Prints the string, replacing the placeholders.
printf(
$posted_in,
get_the_category_list( ', ' ),
$tag_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
}
endif;
yes.
can someone post the original code for the functions php for the twentyten template. I think I need to get back to the original and try this again. Thanks.
http://wordpress.org/download/
just DL a fresh copy to your computer and grab the code
I uploaded the original file (thanks Rev. Voodoo) and now when I follow post 3 and delete the information my page says Fatal error: Call to undefined function twentyten_posted_on() in /home2/jmoseren/public_html/wp-content/themes/twentyten/loop.php on line 128.
Any ideas? Thanks.
remove / or commenting the function twentyten_posted_on() and twentyten_posted_in() in loop.php
I found twentyten_posted_on() in the loop file in a couple spots and I tried deleting some stuff but it didn't work. What parts from below am I supposed to delete? Thanks.
<?php /* How to display posts in the asides category */ ?>
<?php elseif ( in_category( _x('asides', 'asides category slug', 'twentyten') ) ) : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<div class="entry-utility">
<?php twentyten_posted_on(); ?>
<span class="meta-sep">|</span>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-utility -->
</div><!-- #post-## -->
<?php /* How to display all other posts. */ ?>
<?php else : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title">" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></h2>
<div class="entry-meta">
<?php twentyten_posted_on(); ?>
</div><!-- .entry-meta -->
<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<div class="entry-utility">
<?php if ( count( get_the_category() ) ) : ?>
<span class="cat-links">
<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
</span>
<span class="meta-sep">|</span>
<?php endif; ?>
<?php
$tags_list = get_the_tag_list( '', ', ' );
if ( $tags_list ):
?>
<span class="tag-links">
<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
</span>
<span class="meta-sep">|</span>
<?php endif; ?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-utility -->
</div><!-- #post-## -->
<?php comments_template( '', true ); ?>
<?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>
Post long code in http://pastebin.com/ so its easier to read and no markup mistakes from the forum.
<?php twentyten_posted_on(); ?>
just this bit I would think? Could just be commented out like this:
<!-- <?php twentyten_posted_on(); ?> -->
I think its in there twice
thank you, that worked.
Sure thing!
With HTML comment <!-- --> the PHP will still run but will be hidden on the page.
<?php //twentyten_posted_on(); ?> or <?php /* twentyten_posted_on(); */ ?> will comment out the PHP so it won't run at all.
Could you tell me how to remove the comment box on the twenty theme please?
Can you please tell me how to remove this part, especially the Comments Off.
Posted in Uncategorized | Comments Off
I'm new to this, do you mind also helping me with the location of the RSS feed?
Thanks!
This worked a charme for me, to get rid of posted on / posted in. Add this at the end of style.css:
.entry-meta {display:none;}
.entry-utility{display:none;}
doc4
I tried your method and it gave me this:
Fatal error: Call to undefined function twentyten_posted_on() in /home/.../public_html/wp-content/themes/twentyten/loop.php on line 128
Any ideas what I did wrong?
.entry-meta {display:none;}
.entry-utility{display:none;}
What does each command mean?
Just out of curiosity: Is it possible to remove only the date and retain the author?
I have removed the both from the homepage of my photo blog.
Thanks all.
redi1 deleting all of the function will cause the function to not exist thus undefined everytime the function is called.
either delete everything inside function twentyten_posted_on() { } (but you lose it in case you need it) or just comment out <?php //twentyten_posted_on(); ?> where you dont want to use it.
Add this code to style.css under "/* =Content" to remove: Posted by, Posten on, Posted in and comments. Much more simple.
Code: .post .entry-utility, .post .entry-meta {display:none;}
Hello moserengineering,
The best place to remove the code is at Single.php. Look for the code around line 62 that looks like this: <?php twentyten_posted_in(); ?> and either remove it or turn it to a comment. There's no need to edit the functions.php or any other file as this is where the function is called.
This removes both things you asked in one shot. Good luck! :D
Hi I just screwed my blog up momentaily
listbuildingincomepro.com/blog/
Parse error: syntax error, unexpected '.' in /home/listb/public_html/blog/wp-content/themes/twentyten/functions.php on line 459
Can anyone help. I was trying to delete post date.
My screen froze that was computer so not sure what I have done. Initially I deleted the code as above,I thought, that didn't seem to work so put code back everything was fine, then I tried /* and */ Think may have added in wrong place.
Anyone willing to have a look for me please
Cheers
Graeme
Phew I went into fantastico and the version was out of date so i upgraded to current verion fixed the error now to try deleting posts again
hi everyone. in twentyten template, how can i move "by admin" only separated from "posted by"? which part of the code should I move?
This topic has been closed to new replies.