Blog Title not showing up on main Blog page
I believe that first page is your index.php, and I would guess that the code within that file is different from single.php, which is the file used by pages 2 onwards.
I believe that first page is your index.php, and I would guess that the code within that file is different from single.php, which is the file used by pages 2 onwards.
Editing does not change post_name
The filter that allows you to tweak the title value is [wp_title][1]. As mentioned by the commenters, the entry-title is a class pertaining to your theme. If you need to set a class according to a certain value, try something like this in your template file: <h1 class=”<?php echo ($in_category_a) ? ‘align-left’: ”; ?>”><?php the_title();?></h1>
The template tag to check CPTs single page – is_singular. So you can use is_singular(‘songs’) to check if the current post page is a single page for post type songs.
A filter always needs to return something. So in the second example you should try return $title; after the if statement so it doesn’t break other posts. add_filter( ‘sanitize_title’, ‘my_custome_slug’ ); function my_custome_slug( $title ) { return ( ‘customposttype’ === $GLOBALS[‘post’]->post_type ) ? str_replace( ‘*’, ‘-‘, $title ) : $title; } I’m not completely sure … Read more
From what I understand from your question, your best course of action is to assign the node to a WordPress callback function using built-in AJAX. If you don’t know what I’m talking about, you should familiarize yourself with using AJAX in WordPress in the Codex. However, here is a basic overview of steps: Add a … Read more
In the function add_submenu_page() you have to specify a callback function at the end. Like you did it in the 2nd submenu page. You have to add this function to your code! Example: add_submenu_page( ‘my-parent’, ‘Subpage title’, ‘Subpage title’, ‘manage_options’, ‘my_subpage’, ‘subpage-handle’); function subpage-handle() { echo ‘<h1>Subpage title</h1>’; } In this function you can echo … Read more
You should be able to hook into the title by using wp_title filter function se_custom_title( $title ) { if(x == y) { $title=”something”. $title; } return $title; } add_filter( ‘wp_title’, ‘se_custom_titles’ );
Change page title dynamically before header is rendered
Use global variables to pass values from the template to the header. // in the template file global $my_page_title; $my_page_title=”field value”; global $my_meta_description; $my_meta_description = ‘field value’; get_header(); // in the header file global $my_page_title; global $my_meta_description; echo $my_page_title; echo $my_meta_description;