How to get the meta title of a page configured as blog (loop)

Ok, I found the method by myself. This is the code: //… elseif (is_page() || is_single()) { //Page and Post Title global $post; $metatitle = get_post_meta($post->ID, ‘metatitle_value_key’, true); if ($metatitle) { echo stripslashes($metatitle); } else { the_title(); } } elseif (is_home()) { //Using is_home for the blog page //And using get_queried_object $page_object = get_queried_object(); $metatitle … Read more

Different titles for static, posts, and every xy page

Ok solved. <?php if ( is_front_page() && !is_home() ) :?> <h1><a href=”https://wordpress.stackexchange.com/questions/175971/<?php echo esc_url( home_url(“https://wordpress.stackexchange.com/” ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></a></h1> <?php elseif ( is_home() && get_option(‘page_for_posts’) ): ?> <h1><?php echo apply_filters(‘the_title’,get_page( get_option(‘page_for_posts’) )->post_title); ?></h1> <?php else : ?> <h1><a href=”<?php echo get_permalink() ?>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(”); ?></a></h1> <?php endif; ?> … Read more

How to Implement Category.php page title in wordpress custom template?

Your code is fine, the only problem here is a syntax error. Always remember to remove any spaces between the opening and closing tags – otherwise your code will fail. Example: <h2> <a href=”#” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”> <?php the_title(); ?> </a> </h2> Make sure to read the WordPress Codex about the_title_attribute() … Read more

How to modify title tag in a plugin?

What I actually ended up doing was to use filter document_title_parts. https://developer.wordpress.org/reference/hooks/document_title_parts/ I just unshifted a value to the array. I don’t think the documentation actually is very clear about that. And this method still don’t work with Yoast SEO installed.

Setting Page Title Yoast

It sounds like you’re trying to modify document’s <title> tag as opposed to the post titles typically wrapped in <h1>/<h2> tags, which you’ve already accomplished. If the theme you’re using implements titles in the WordPress 4.4+ manner, you can use the document_title_parts filter: /** * document_title_parts * * Filters the parts of the document title. … Read more

What change does this code need to include title of parent?

You can get all parent post id by get_post_ancestors function. add_filter( ‘document_title_parts’, ‘change_wp_title’, 20, 1 ); function change_wp_title( $title ) { global $post, $paged; $grappig = $title; // 404 if ( is_404() ) { $title[‘title’] = ‘file not available’; } elseif ( is_singular( ‘schedule’ ) ) { // get all parent post’s id $parents = … Read more

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