Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    Sorry for the delay on getting back to you–we had virtually no internet while traveling for the holiday.

    So, if I understand you, you’d like for the title to overlay on pages, and the blog page, but not the individual posts themselves, right? I believe this filter will manage what you want:

    add_filter( 'display_featured_image_genesis_do_not_move_titles', 'rgc_do_not_move_on_posts' );
    function rgc_do_not_move_on_posts( $post_types ) {
    	$post_types[] = is_singular( 'post' );
    	return $post_types;
    }

    Don’t check the setting to not move the titles on the settings page, and this should override that on individual posts. HTH

    By the way, I like the styling you’ve done on the overlay titles!

    Thread Starter amazemedia

    (@amazemedia)

    No worries on delay. Yes that is close to what I was describing. I was curious if on the individual posts the title “Newsroom” could be displayed as the default overlay title. No worries if this is beyond the scope or your availability, I can add title as part of image if need be. Thx again!

    Plugin Author Robin Cornett

    (@littlerchicken)

    Ah, I see. Well, there isn’t currently a filter in place to allow you to override the title for the plugin output, although I suppose I could add one. I know I thought about it but couldn’t decide how it would be beneficial, but I could add it.

    However, I’m not sure it would really help, as I am not sure it’s possible to make the plugin output the title twice, which I think is effectively what you’d be wanting to do–one as the overlay, and one for the actual post title below, correct?

    What I think I’d look into instead, would be to use the code I posted above, and then add the “Newsroom” bit almost by hand, using the display_featured_image_genesis_before_title hook. You can dynamically pull the blog page title, so even if it gets changed, you won’t get into trouble, and just copy the markup that the plugin uses. So you’d be looking at something like this (totally not tested anywhere at all, just thinking out loud):

    add_action( 'display_featured_image_genesis_before_title', 'rgc_add_newsroom' );
    function rgc_add_newsroom() {
    	if ( is_singular( 'post' ) ) {
    		return;
    	}
    	// set $title and $itemprop
    	printf( '<h1 class="entry-title featured-image-overlay" %s>%s</h1>', $itemprop, $title );
    }

    You can see how the plugin does this in the class-displayfeaturedimagegenesis-output.php file, specifically the do_the_title and do_backstretch_image_title functions. HTH

    Plugin Author Robin Cornett

    (@littlerchicken)

    Sorry, belatedly realizing that first line for the early return should be

    if ( ! is_singular( 'post' ) ) {

    instead.

    Thread Starter amazemedia

    (@amazemedia)

    Perfect! Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Blog post title’ is closed to new replies.