WordPress.org

Support

Support » Themes and Templates » Customizr » [Resolved] Remove title on Custom Page

[Resolved] Remove title on Custom Page

  • I had been just commenting out the Title on a custom page (child theme -> album-gallery-page.php), but didn’t work after upgrading to the new theme.

    Can I filter it out something like this:

    /*Remove Album Gallery Title*/
    add_filter('wp_title', 'set_page_title');
    function set_page_title($title) {
      if (is_page_template('album-gallery-page.php')) {}
      else
         return $title;
    }

Viewing 6 replies - 1 through 6 (of 6 total)
  • https://codex.wordpress.org/Function_Reference/wp_title
    You want to remove the title.. that one you see on the browser bar?

    No the one displayed on the page. The entry header?

    So wrong filter.
    In this custom template you have something like that: right?

    <?php
    /*
    Template Name: gallery
    */
    ?>
    <?php do_action( '__before_main_wrapper' ); ##hook of the header with get_header ?>

    make it become that:

    <?php
    /*
    Template Name: gallery
    */
    ?>
    <?php
    remove_action('__before_content',array(TC_headings::$instance, 'tc_content_headings'));
    ?>
    <?php do_action( '__before_main_wrapper' ); ##hook of the header with get_header ?>

    Hope it helps.

    Beautiful! I had just discovered that filtering out the_title as opposed to wp_title would do the trick. But your way makes much more sense because it’s specific to the one page. Thank you again.

    Yeah if I have to use a custom template I prefer to put there specific hacks.
    Plus if you remove the action you will skip all the customizr logic to print it..
    (Mind marking this topic as resolved?)

    And then some.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Remove title on Custom Page’ is closed to new replies.
Skip to toolbar