Print title page in header of a specific page
I was spelling wrong statement. This worked fine for me <?php if (is_page(’80’) ) { echo get_the_title();}?> thanks
I was spelling wrong statement. This worked fine for me <?php if (is_page(’80’) ) { echo get_the_title();}?> thanks
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
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
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
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
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
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
Thanks to @shanebp for reminding me to simplify add_filter(‘wp_title’, ‘dev_srv_title’); function dev_srv_title($title) { $host = $_SERVER[‘SERVER_ADDR’]; if ($host ==’0.0.0.0′) { return ‘DEV SRV: ‘.$title; } return $title; }
if you have access to your database, as every posts are registered in the (wp_/ or whatever is your prefix )posts , you can probably do it via sql something like update wp_posts SET post_title = substring(post_title,1, CHAR_LENGTH(post_title) – 10)) WHERE post_title like ‘%With Table’
I use this plugin together with TwentyTen too and encountered the same problem. My solution is to leave wp_title( ‘|’, true, ‘right’ ); unchanged but only enable the call to function bloginfo() in the next line if plugin WordPress SEO is inactive. include_once( ABSPATH . ‘wp-admin/includes/plugin.php’ ); // Add the blog name. if ( is_plugin_inactive(‘wordpress-seo/wp-seo.php’) … Read more