Leave a Reply

3 comments

  1. It looks like you’re “quoting” the title function – essentially, turning it into a string, when you should just be calling it.

    <?php if(get_post_meta($page->ID, "p30-disc", true)==the_title()) { ?>
    

    that should work?

  2. You can use get_the_title() function to route your pages or display specific content.

    if ( is_front_page() || is_home() ) :
        get_template_part( 'template-parts/content', 'home' );
    elseif(get_the_title() === 'account'):
        get_template_part( 'template-parts/content', 'account' );
    elseif(get_the_title() === 'login'):
        get_template_part( 'template-parts/content', 'login' );
    else :
        get_template_part( 'template-parts/content', 'page' );
    

    note this is case sensitive so if your page title is all lower case then your string should be to.