Forums

[resolved] How to remove page title when page.php doesn't contain title code (5 posts)

  1. Dnal
    Member
    Posted 1 year ago #

    Usually if I wanted to hide a page title (for example, if using a static page as the front page of my site) I could just remove code something like <h2><?php the_title() ?></h2> from page.php or make a new file, "homepage.php" which had the entire contents of page.php except for the title code.

    However, in the theme I'm editing, page.php looks like this:

    <?php
     /* Mystique/digitalnature */
     get_header();
    ?>
    
      <!-- main content: primary + sidebar(s) -->
      <div id="main">
       <div id="main-inside" class="clear-block">
        <!-- primary content -->
        <div id="primary-content">
         <div class="blocks">
           <?php do_action('mystique_before_primary'); ?>
           <?php
    
            if (have_posts()):
             while (have_posts()):
              the_post();
              mystique_page();
             endwhile;
            endif;
    
            comments_template();
           ?>
           <?php do_action('mystique_after_primary'); ?>
         </div>
        </div>
        <!-- /primary content -->
    
        <?php get_sidebar(); ?>
    
       </div>
      </div>
      <!-- /main content -->
    
    <?php get_footer(); ?>

    How can I remove the page title?

  2. duca
    Member
    Posted 1 year ago #

    In the page use custom fields: hide_title

  3. Dnal
    Member
    Posted 1 year ago #

    Thanks a lot, that worked great!

  4. tombanh
    Member
    Posted 10 months ago #

    Hi,

    I followed your instructions by putting a check mark in the "Custom Fields" box, then I located the "About" page and specified the Custom Field Name "About" and Custom Field Value "hide_title", but it doesn't work.

    I am using the Mystique theme ver 2.4.2 and I am having the same issue.

    I am so new to WordPress as your help is appreciated!

    Tom

  5. tombanh
    Member
    Posted 10 months ago #

    It works now! Many thanks!

    hide_title should be in both Name and Value fields.

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic