0

I pass a template_redirect in wordpress as hook but I want to have a personnalized title for this page and I miss to do that. Has someone any idea ?

add_action( 'template_redirect', 'virtual_pages' );
function virtual_pages() {
    global $wp;
    if (strtolower($wp->request) == 'virtual-page'){ 
        remove_all_actions( 'builder_add_title' );
        add_action( 'builder_add_title', "<title>Custom Title</title>\n" );
        include( get_stylesheet_directory() . '/test.php' );
       exit();
    }
}
  • Are you using any framework or what? builder_add_title does not seem to be WordPress thing. – Nilambar Sep 9 '14 at 3:31
  • @Nilambar: I don't use any framework. Only wordpress but it doesn't work, so It's probably for that. Any idea on how to do ? – Alexis G Sep 9 '14 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.