Viewing 5 replies - 1 through 5 (of 5 total)
  • are you using a seo plugin?

    what version of the theme are you using?

    Thread Starter aroengbinang

    (@aroengbinang)

    Hi Michael,

    I’m using Greg’s High Performance SEO, and Twenty Fifteen 1.3 version. Thanks for replying, hope to get some lights about the issue.

    Best regards,
    Bambang

    an unedited Twenty Fifteen 1.4 in my local install, without plugins, does not show Page 1 on the first page of a paginated post.

    there does not seem to be a difference in the corresponding code between v1.3 and v1.4 of the theme; both use add_theme_support( 'title-tag' );

    try looking into the documentation or settings of your seo plugin.
    or temporarily deactivate the plugin (make sure that you do not loose your seo entries) to see if that changes the issue .
    or ask in the plugin’s forum at https://www.ads-software.com/plugins/gregs-high-performance-seo/#postform

    Thread Starter aroengbinang

    (@aroengbinang)

    Awesome!

    It’s not theme issue, but on the Greg’s High Performance SEO plugin’s setting under “Main Titles”. Many thanks for turning on the lights!

    Cheers,
    Bambang

    Thread Starter aroengbinang

    (@aroengbinang)

    For the benefit for those who need it, these are the solutions that I got through email from Jevuska (https://www.jevuska.com/). Many thanks to him!

    To remove paging title from the first page of the paginated post, add to functions.php:

    if ( class_exists( 'gregsHighPerformanceSEO' ) ) :
        add_filter( 'pre_get_document_title', function( $title ) {
            if ( is_single() && ( int ) 2 > get_query_var( 'page' ) )
                return single_post_title( '', false ); //custom title
                #return ''; //back to default post title
            return $title;
        } );
    endif;

    To remove paging Meta Description of the first page of the paginated posts, add to functions.php

    /**
     * Remove action from anonimous class name
     * Credit https://github.com/herewithme/wp-filters-extras/blob/master/wp-filters-extras.php
     * Build again meta description
     *
     */
    if ( class_exists( 'gregsHighPerformanceSEO' ) ) :
        add_action( 'wp', function( $wp ) {
            if ( isset( $wp->query_vars['page'] ) && ( int ) 2 > $wp->query_vars['page'] )
            {
                //remove plugin hook
                global $wp_filter;
                $hook_name   = 'wp_head';
                $priority    = 2;
                $class_name  = 'gregsHighPerformanceSEO';
                $method_name = 'head_desc';
                if ( ! isset( $wp_filter[ $hook_name][ $priority ] ) || ! is_array( $wp_filter[ $hook_name ][$priority ] ) )
                    return false;
    
                foreach( ( array ) $wp_filter[ $hook_name ][ $priority ] as $unique_id => $filter_array )
                {
                    if ( isset( $filter_array['function'] ) && is_array( $filter_array['function'] ) ) {
                        if ( is_object( $filter_array['function'][0] ) && get_class( $filter_array['function'][0] ) && get_class( $filter_array['function'][0] ) == $class_name && $filter_array['function'][1] == $method_name )
                        {
                            unset( $wp_filter[ $hook_name ][ $priority ][ $unique_id ] );
                        }
                    }
                }
                return false;
            }
        } );
    
        //build new meta description early
        add_action( 'wp_head', function() {
            if ( is_single() && ( int ) 2 > get_query_var( 'page' ) )
            {
                $gregsHighPerformanceSEO = new gregsHighPerformanceSEO;
                echo $gregsHighPerformanceSEO->head_desc();
            }
        }, 2 );
    
    endif;
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to Remove ", Page 1" in Paginated Single Post’ is closed to new replies.