WP Router Placeholder Page

#95368
  • Resolved Spontis
    Rank Math free

    Hello,

    i’m using Rank Math Seo together with “The Events Calendar” Plugin from Modern Tribe.

    For this I created a custom template (“page-event.php”) to display an event page. The plugin then uses this template automatically for all generated Event-Pages. Unfortunately, in this case, Rank Math SEO fills the page title to “WP Router Placeholder Page”. Can I influence this within the custom template?

    Here the page-event.php:

    
    /*
    * Template Name: Veranstaltungen
    */
    
    get_header(); ?>
    
        <div id="eventkalender" class="td-main-content-wrap td-container-wrap">
            <div class="td-container">
    		<div class="td-crumb-container">
                    <?php echo tagdiv_page_generator::get_breadcrumbs(array(
                        'template' => 'page',
                        'page_title' => get_the_title(),
                    )); ?>
              
                </div>
                <div class="td-pb-row">
                    <div class="td-pb-span8 td-main-content">
                        <div class="td-ss-main-content">
                            <?php
                                if (have_posts()) {
                                    while ( have_posts() ) : the_post();
                                        ?>
    									<div class="td-page-header">
                                            <h1 class="entry-title td-page-title">
                                                <span><?php the_title(); ?></span>
                                            </h1>
                                        </div>
                                        <div class="td-page-content tagdiv-type">
                                            <?php the_content(); ?>
                                        </div>
                                <?php endwhile;//end loop
                                    comments_template('', true);
                                }
                            ?>
                        </div>
                    </div>           
                </div>
            </div>
        </div>
    
    <?php get_footer(); ?>

    `

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    Thank you for getting in touch with us.

    You can use the following filter to modify the title generated for your page by Rank math:

    
    /**
     * Filter to change the page title.
     * 
     * @param string $title
     */
    add_filter( 'rank_math/frontend/title', function( $title ) {
    	return $title;
    });
    

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hey Michael,

    thanks for your reply!

    Unfortunately, the snippet doesn’t change the Title. Tried to place the code in the page-event.php directly and also in funtions.php of the Theme-Directory.

    Did i do something wrong?

    Best regards,
    Robert

    EDIT: You can see the Site HERE in Action.

    Alberto
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    Just to be sure, did you use the code my colleague shared, or did you modify it? Since you would need to modify it to make it work for your site, it was just the base to work with.

    If you have modified it, could you share the code?

    Looking forward to helping you. Thank you.

    ​​​​​​​

    • This reply was modified 3 years, 6 months ago by Alberto.

    Hello again,

    thanks for answering me again.

    No, i didn’t change or modify the code. Which part has to be changed and where it hast to been placed?

    Best Regards,
    Robert

    Hello,

    You’ll need to assign the title variable some content or a title you wish to show for your pages, for example, $title = 'MY CUSTOM TITLE';

    With this the variable will return some title content: return $title;

    If you wish to only apply the changes to your Events page, please inquire with the plugin support on how to apply customization specific to the pages. It should be something like if(is_eventpage){ //do your customization }

    Hope this helps you. Thank you.

    ​​​​​​

    It is me (again),

    where i have to enter the snippet? In the “functions.php” within the theme-directory or in the page-event.php (from above) in the same directory? Tested it both and also before “get header” and after “get header”. Doesn’t work 🙁

    $title = 'My own Title';
    add_filter( 'rank_math/frontend/title', function( $title ) {
    	return $title;
    });

    Sorry for bothering you with it again, unfortunately I’m not a php professional to find the solution myself.

    Hello,

    I am sorry but we don’t usually offer code customizations.

    You can however try as follows:

    
    /**
     * Filter to change the page title.
     * 
     * @param string $title
     */
    add_filter( 'rank_math/frontend/title', function( $title ) {
    if(is_eventpage){       
    $title = 'my custom title';
    	return $title;
    }
    return $title;
    });
    

    The code should be added to your theme functions.php file.

    Hoping this helps you. Thank you.

    ​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)

The ticket ‘WP Router Placeholder Page’ is closed to new replies.