Custom post type split title, setup permalink accordingly

I have been working on this solution, I have come up with a different idea to implement this – I have added two different meta boxes, one with First Name, the other with Last Name Then I have hooked a function with save_post_{$post->post_type} hook like this – add_action( “save_post_{$post->post_type}”, “update_post_data” ); function update_post_data( $post_id ) … Read more

Custom Post-Rename Function Does Not Function in WordPress 6.x

The call to get_the_ID() possibly worked by happy coincidence of there being an available post object to pull the ID from. However, realistically you should have been looking at data available to the filter for this ID instead, here’s how. First update you add_filter declaration to bring in the second variable from wp_insert_post_data. add_filter( ‘wp_insert_post_data’ … Read more

Title displaying multiple times

The function wp_title() is supposed to be used to generate the text for the title tag: <head> <title><?php wp_title();?></title> … </head> but to display the current post title within the loop, you should instead use the the_title() function.

I have a problem with Home Page title

This is more of an SEO question than a WordPress one… Changes won’t happen until after Google re-crawls your site – that is, the next time a googlebot visits your site and updates their information about your site. Wait for the next time they do. The rate/timing for the next googlebot crawl varies by site

Show page name in browser

Your title is being set by something in your theme or a plugin attaching to the wp_title filter. You can further filter this value or override it entirely by using the same hook and a different priority that executes later. // add a filter at priority 999 so it will presumably run last add_filter( ‘wp_title’, … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)