Rename file after title , one small problem

Use get_the_title() since you’re already being passed a post ID. function rename_attacment( $post_ID ) { $post = get_post( $post_ID ); $file = get_attached_file( $post_ID ); $path = pathinfo( $file ); //dirname = File Path //basename = Filename.Extension //extension = Extension //filename = Filename $newfilename = get_the_title( $post_ID ); $newfile = $path[‘dirname’] . “https://wordpress.stackexchange.com/” . $newfilename … Read more

How to put title slug into content when create a new post?

You have to use the_content filter. Following example is to just adds a featured image set from the single post Edit screen which displays before the content on single posts only. You can change it to display title and permalink. add_filter( ‘the_content’, ‘featured_image_before_content’ ); function featured_image_before_content( $content ) { if ( is_singular(‘post’) && has_post_thumbnail()) { … Read more

reformat entry-title with two different styles

ok found out – added this to my content-page.php maybe not nice, but works for now… <?php $pieces = explode(‘:’, the_title( ”, ”, false ), 2 ); if (2 == count($pieces)) : ?> <h1 class=”entry-title”><span><span style=”font-size: 24px;”><?php print $pieces[0]; ?>: </span><span><?php print $pieces[1]; ?></span></span></h1> <?php else : ?> <h1 class=”entry-title”><?php the_title(); ?></h1> <?php endif; ?>

clicking on page title

usually the code that makes a link to a title in WordPress looks something like this <a href=”https://wordpress.stackexchange.com/questions/66152/<?php the_permalink(); ?>”><php the_title(); ?></a> if you were to change it to this <?php the_title(); ?> it would only display the title. It would remove the link. Does that answer your question?

Change Bookmark Name without Changing TITLE Tag [closed]

No, title tags are the way you set your default titles when bookmarking. It’s entirely up to the user whether they want to change it from that default. Sidenote: This question is also more appropriate for StackOverflow as it doesn’t directly relate to WordPress (WordPress Answers is solely for WordPress-related questions). 🙂

Remove post title in catogory page

In your page template you can use the conditional statement is_category($category) to determine if the header should show: if (!is_category(‘fun’)){ the_title(); } … OR … Better: You can create a category template and not include the_title() in that template file. This is a cleaner way to ensure only that one category page leaves out the … Read more