Front page displays different than all other pages?

I’m not very sure how is your title on other pages, but here is how you can modify your title: <?php wp_title( ‘|’, true, ‘right’ ); ?> This will show your Blog’s name right to your page’s title, which will have seo benefits. The | separator will be used here. If you want to customize … Read more

How to give titles to custom post type as “unique” incremental number?

The method for increment you used will not achieve what you want to if you delete the posts. Instead you can save the counter in wp_options table on front-end form submission, something like: if(get_option(‘customers_count’)){ $count = get_option(‘customers_count’, true); update_option(‘customers_count’, $count+1); } else { /** This will automatically add the option if it does not exist. … Read more

How can I add a title to this ‘maintenance mode’ function?

You can pass a title to the wp_die() function or even any other HTML content like heading tags: https://codex.wordpress.org/Function_Reference/wp_die But if you are trying to have more control over what’s being outputted, you should use the template_include filter and use your custom template: https://codex.wordpress.org/Plugin_API/Filter_Reference/template_include EXAMPLE: add_filter( ‘template_include’, ‘show_maintenance_page’, 99 ); function show_maintenance_page( $template ) { … Read more

How come I get internal server error even with try catch for get_the_title in functions.php?

You can avoid hard coded title tag in your theme template. Just use theme support. add_theme_support(‘title-tag’); OR, If you want to use title tag then you can do something like this. <title><?php wp_title(‘|’, true, ‘right’);?></title> You can then apply filter as /** * Filters wp_title to print a neat <title> tag based on what is … Read more

Change meta data of pdf file

Google also pulls information from the PDF file itself. To truly fix the files, you’ll need Acrobat Pro. You can then edit the embedded title, and you then delete the original and upload a new one. If these PDFs are associated with specific Posts or Pages, it’s safest to go to that individual Post or … Read more

How to put post title or keyphrase in content on different places automatically?

You can search-replace those placeholders with the_content filter. function custom_the_content( $content ) { return str_replace(‘{placeholder}’, get_the_title(), $content); } add_filter(‘the_content’, ‘custom_the_content’); Note: I don’t recommend using *** or similar as a placeholder, as it can be commonly used. That is why I’ve used {placeholder}. UPDATE: Based on the comments below, if you need to search-replace multiple … Read more

How to add publish date in the title

if the output you see is ABC [post_published], then it means your shortcode isn’t working as it should. try including following code at the end of inside your theme’s functions.php file. function ppd_shortcode(){ return get_the_date(); } add_shortcode(‘ppdate’, ‘ppd_shortcode’); When you register a shortcode using the add_shortcode function, you pass in the shortcode tag ($tag) and … Read more

how to set alt & title for featured image get_the_post_thumbnail

You can use the second parameter of the_post_thumbnail() function. the_post_thumbnail( ‘mudra-featured-image’, [‘alt’ => get_the_title()] ); Another option, you can do this using the filter wp_get_attachment_image_attributes add_filter(‘wp_get_attachment_image_attributes’, function($attr){ $attr[‘alt’] = get_the_title(); return $attr; }); Note, using the filter will affect other images printed using any function that depends on wp_get_attachment_image() So, you may use the other … Read more

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