Page title problem
-
I’m using Elegance theme, and if I enable Ceceppa plugin I cannot get page title.
Now my site just show the url (example: https://home.bdidut.info/contact/)The theme invoke page title by:
add_action( 'mysite_before_page_content', 'mysite_page_title' );
And the function:function mysite_document_title() { global $wp_query; # Set up some default variables. $doctitle = ''; $separator = ' |'; $post = $wp_query->get_queried_object();
…
if ( is_page() ) { $page_title_format = mysite_get_setting( 'seo_page_title_format' ); $page_title_override = trim( get_post_meta( $post->ID, '_seo_title', true ) ); if( get_post_meta( $post->ID, '_seo_disable', true ) || !in_array( get_post_type( $post->ID ), mysite_seo_posttypecolumns() ) ) { $doctitle = mysite_seo_replace( '%page_title%', $post ); } else if ( !empty( $page_title_override ) ) { $doctitle = $page_title_override; } else if ( trim( $page_title_format ) ) { $doctitle = mysite_seo_replace( $page_title_format, $post ); } else { $doctitle = mysite_seo_replace( '%page_title%', $post ); } }
…
if ( ( ( $page = $wp_query->get( 'paged' ) ) || ( $page = $wp_query->get( 'page' ) ) ) && $page > 1 ) { $seo_paged_format = mysite_get_setting( 'seo_paged_format' ); if( trim( $seo_paged_format ) ) { $doctitle = $doctitle . str_replace( '%page%', $page, $seo_paged_format ); } else { $doctitle = sprintf( __( '%1$s Page %2$s', MYSITE_TEXTDOMAIN ), $doctitle . $separator, number_format_i18n( $page ) ); } } # Apply the wp_title filters so we're compatible with plugins. $doctitle = apply_filters( 'wp_title', $doctitle, '', '' ); # Print the title to the screen. echo apply_atomic( 'document_title', esc_attr( $doctitle ) ); }
Maybe there is problem about using
global $wp_query
?https://www.ads-software.com/extend/plugins/ceceppa-multilingua/
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Page title problem’ is closed to new replies.