No Page Title - Renew

Hi,

How can I show the page title in renew please?

https://shootingsuppliesltd.co.uk

Thanks,

Hi @daz1uk,

Renew stack does not output page titles when using the default templates, It does however have the page title on the Landmark section when you’re using a Blank template. Landmark section is inside the Header/Masthead so if you’re using a Custom Header that Landmark won’t show either.

Please install and activate the child theme and login through FTP then add this on your child theme’s functions.php file to show a page title.

/*Adding title to renew pages*/
function add_title() {
  if(is_singular('page')) { ?>
         <header class="entry-header mbm">
            <h1 class="entry-title"><?php the_title(); ?></h1>
          </header>
 <?php }
}
add_action( 'x_before_the_content_begin', 'add_title', 10 );

Hope this shed some lights,
Cheers!

Thanks @Jade

You’re most welcome, @daz1uk. :slight_smile:

Hi Jade,

What would I need to change the ‘page’ to, to display the title on the blog roll & category pages please?

Hey there,

You can achieve this by doing the following steps:

  1. On your child theme, create these folders: /framework/views/renew. So you’ll create the framework folder, then inside it is the views folder which then contains the renew folder.

  2. On that folder path, create the file named wp-index.php file which contains this content.

<?php

// =============================================================================
// VIEWS/RENEW/WP-INDEX.PHP
// -----------------------------------------------------------------------------
// Index page output for Renew.
// =============================================================================

get_header();

?>

  <div class="x-container max width offset">
    <div class="<?php x_main_content_class(); ?>" role="main">
    	
    	<?php
			if( is_home() ){
				$title = get_queried_object()->post_title;
			}elseif( is_category() ){
				$title = get_queried_object()->name;
			}
		?>

		<?php if( is_home() || is_category() ) : ?>
			<header class="entry-header mbm">
	    	    <h1 class="entry-title"><?php echo $title; ?></h1>
			</header>
		<?php endif; ?>

      	<?php x_get_view( 'global', '_index' ); ?>

    </div>

    <?php get_sidebar(); ?>

  </div>

<?php get_footer(); ?>

Tell us how it goes. Thanks.

Worked perfectly, thanks @benursal

You’re most welcome!
We’re glad @BenUrsal were able to help you out.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.