• Resolved stuart

    (@lone-walker)


    In a PAGE the page-title div displays the title of the page, but in a POST it displays the categories associated with that post.

    Is it possible to change the title of the POST to be the text I placed in the title field?

    Hope that makes sense
    Thanks
    LW

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi LW. Do you still want to display the normal post title below that?

    Thread Starter stuart

    (@lone-walker)

    Hmm, probably not, that would be repetitive.

    Just the post title in place of the categories would work for me ??

    You need to be using a child theme. If you’re not, let me know and I’ll post some quick instructions on how to get one.

    1. Copy this file:

    wp-content/themes/hueman/inc/page-title.php

    to your child theme:

    wp-content/themes/your-child-theme/inc/page-title.php

    2. Find this section at the top of the file:

    <?php elseif ( is_single() ): ?>
    	<ul class="meta-single group">
    		<li class="category"><?php the_category(' <span>/</span> '); ?></li>
    		<?php if ( comments_open() && ( ot_get_option( 'comment-count' ) != 'off' ) ): ?>
    		<li class="comments"><a href="<?php comments_link(); ?>"><i class="fa fa-comments-o"></i><?php comments_number( '0', '1', '%' ); ?></a></li>
    		<?php endif; ?>
    	</ul>

    3. Replace it with this. This changes the page title to use the post title on the single post pages:

    <?php elseif ( is_single() ): ?>
    	<!-- Change post page title to post title
    	<ul class="meta-single group">
    		<li class="category"><?php the_category(' <span>/</span> '); ?></li>
    		<?php if ( comments_open() && ( ot_get_option( 'comment-count' ) != 'off' ) ): ?>
    		<li class="comments"><a href="<?php comments_link(); ?>"><i class="fa fa-comments-o"></i><?php comments_number( '0', '1', '%' ); ?></a></li>
    		<?php endif; ?>
    	</ul>
    	-->
    	<h2><?php echo alx_page_title(); ?></h2>

    4. Then add this to your custom css:

    /* hide default post title on single post pages */
    .single .post-title {
      display: none;
    }
    Thread Starter stuart

    (@lone-walker)

    Thanks bdbrown

    This works a treat!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change Title Text in Posts’ is closed to new replies.