Page title and parent page duplication

Responsive WordPress theme suitable for Schools, Colleges or educational websites.
GK User
Thu Nov 06, 2014 7:31 pm
Hi There,

I'd like to change is so that the heading is the top level parent name and then the child pages names are used on the white area as curreently it looks like dulication, see:

http://demo.gavick.com/wordpress/university/about-us/

For the above example I'd like to call the About Us - "About Us" and then any children will keep "About Us" at the top but will use their individual names on the child pages.

You have this working on the Posts (category name at top, post name in white area).

Any ideas?
User avatar
Expert Boarder

GK User
Thu Nov 06, 2014 10:48 pm
Hi,

You can disable this title block at all (black background) in Template Options -> Features -> Page title block option.

or change this fragment from University/layouts/before.php:
Code: Select all
      elseif (is_page()) {
         echo '<h2 id="gk-page-title" class="gk-page"><span>' . get_the_title() . '</span></h2>';
      }


into:
Code: Select all
      elseif (is_page() && !$post->post_parent > 0) {
         echo '<h2 id="gk-page-title" class="gk-page"><span>' . get_the_title() . '</span></h2>';
      }

      elseif ( is_page() && $post->post_parent > 0 ) {
         echo '<h2 id="gk-page-title" class="gk-page"><span>' . get_the_title( $post->post_parent ) . '</span></h2>';
      }

to add modification for child pages.
User avatar
Moderator

GK User
Tue Nov 11, 2014 3:19 pm
Perfect Thanks.
d
User avatar
Expert Boarder


cron