• i have a posttype to which i have a page templates assigned using plugin custom posttype page template, so that my posts having img attachments in the posttype are displayed using a particular template. In my header.php i have code

    if ( is_page_template ( 'page-book.php' ) )
    				{ $currenturl=$_SERVER['REQUEST_URI'];
    				  $booktitle = str_replace("https://mybooks.com/books/", "", $currenturl);
    				  $booktitle = str_replace("-", " ", $booktitle);
    				  $booktitle = strtoupper($booktitle);
    				  echo $booktitle;
    				}

    but it echoes the url of the post in the title instead of the custom echo

    how do i get it to echo the custom title

  • The topic ‘unable to echo custom title if page’ is closed to new replies.