• Resolved jeremyjgray

    (@jeremyjgray)


    Terrific plugin!

    Small question. In a support query about 11 months ago, entitled “Works but doesn’t eliminate title height”, you suggested adding this to the functions.php file:

    ___

    ‘function return_page_title_html_block($post) { $is_page_title_active = get_post_meta($post->ID, $key = ‘toggle_page_title’, $single = true); if($is_page_title_active == ” || $is_page_title_active) return ‘
    ‘ . $post->post_title . ‘

    ‘; return ‘ ‘; }’

    (without the tick marks of course)

    __

    In your suggested code above, I’m not sure how many tick marks to delete (and crashed my page briefly as a result). Would the code look like this?

    ___

    function return_page_title_html_block($post) { $is_page_title_active = get_post_meta($post->ID, $key = toggle_page_title, $single = true); if($is_page_title_active == || $is_page_title_active) return
    . $post->post_title .

    ; return ; }

    ____

    And then, do I absolutely have to do the following to make it work (also your suggestion from back then):
    ___

    2) In your page.php file replace the title with the h1 tags to a call to echoing out the above function – print return_page_title_html_block($post);

    ___

    Many thanks in advance!
    Jeremy

    https://wordpress.org/plugins/toggle-the-title/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter jeremyjgray

    (@jeremyjgray)

    p.s. My URL is toastmasters90th.org .

    Plugin Author avner.komarow

    (@avnerkomarow)

    hi
    please try to copy and paste (with tick marks and all) this:
    1.

    function return_page_title_html_block($post) {
    	$is_page_title_active = get_post_meta($post->ID, $key = 'toggle_page_title', $single = true);
    	if($is_page_title_active == '' || $is_page_title_active)	return '' . $post->post_title . '';
    	return ' ';
    }

    2.

    print return_page_title_html_block($post);

    does it help?

    Thread Starter jeremyjgray

    (@jeremyjgray)

    Thanks for your helpful reply! It hasn’t worked yet, but it hasn’t crashed my site either. So far, so good 😉

    Re number 2. above, I could not find the spot in the page.php file to “replace the title with the h1 tags to a call echoing out the above function.” FYI here’s the entire coding of that file, from my Catch Evolution theme:

    ___________

    <?php
    /**
    * The template for displaying all pages.
    *
    * This is the template that displays all pages by default.
    * Please note that this is the WordPress construct of pages
    * and that other ‘pages’ on your WordPress site will use a
    * different template.
    *
    * @package Catch Themes
    * @subpackage Catch_Evolution_Pro
    * @since Catch Evolution 1.0
    */

    get_header(); ?>

    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( ‘content’, ‘page’ ); ?>

    <?php comments_template( ”, true ); ?>

    <?php endwhile; // end of the loop. ?>

    </div><!– #content –>
    </div><!– #primary –>

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    _________

    I then went ahead and pasted …

    print return_page_title_html_block($post);

    … at the bottom of page.php (not forgetting to clear my cache, too), but there is still no change.

    Does that give you enough info? Thanks again.

    Plugin Author avner.komarow

    (@avnerkomarow)

    take a look at:

    <?php get_template_part( 'content', 'page' );

    so i guess you need to edit “content-page.php“. and there replace it :-).

    Thread Starter jeremyjgray

    (@jeremyjgray)

    This didn’t work – rather, it appeared to disable your plugin. In content-page.php I pasted your suggested code into the section:

    <h1 class=”entry-title”>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘catchevolution’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”><?php the_title(); ?></h1>

    … so that it looked like this:

    <print return_page_title_html_block($post); ?>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘catchevolution’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”><?php the_title(); ?></h1>

    I tried it with and without the question mark after your code (wasn’t sure if it was necessary). In both cases, the result looked like this screenshot.

    In the screenshot, you can see the original title location and my new title below it, as it is now typed into the top of the body text.

    Thanks!

    Thread Starter jeremyjgray

    (@jeremyjgray)

    It just occurred to me: should I just change the top padding for the text?

    That way, in theory, I’d move the title in my page text up to the height of the original title.

    Plugin Author avner.komarow

    (@avnerkomarow)

    try replase to this function in functions.php:

    function return_page_title_html_block($post) {
    	$title_to_return = '<h1 class="entry-title">" title="' .printf(esc_attr__('Permalink to %s', 'catchevolution' ), the_title_attribute('echo=0')) .'" rel="bookmark">'. 	$post->post_title .'</h1>';
    	$is_page_title_active = get_post_meta($post->ID, $key = 'toggle_page_title', $single = true);
    	if($is_page_title_active == '' || $is_page_title_active)	return '' .$title_to_return . '';
    	return ' ';
    }

    and completely replace this code (all of it):

    <h1 class="entry-title">" title="<?php printf( esc_attr__( 'Permalink to %s', 'catchevolution' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></h1>

    with this one:

    print return_page_title_html_block($post);

    Thread Starter jeremyjgray

    (@jeremyjgray)

    I’ve been busy but will definitely try your suggestion tomorrow, thanks for providing. So please don’t think I’ve lost interest! 😉

    Plugin Author avner.komarow

    (@avnerkomarow)

    its been 2 weeks with no replay, i am resolving the issue.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Eliminating the original title space (redux)’ is closed to new replies.