• Resolved mammothca

    (@mammothca)


    Hi Robin,

    Great plugin! I was just getting into implementing this via some code from Sridhar, when I realized it was going to be a bigger job than I anticipated, but then I stumbled across your plugin, which is exactly what I was looking to do… plus so much more. Thanks for your contribution to the Genesis Community.

    So far the plugin works great, but I am stumped on how to only overlay page titles, and not post titles. I looked through your example code but couldn’t find an example.

    Is this possible?

    Thanks
    Doug

    https://www.ads-software.com/plugins/display-featured-image-genesis/

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

    (@littlerchicken)

    Hey Doug! That’s an interesting question, and one I had not considered. I think I’ve incorporated a way to accomplish this, if you are willing to be a bit of a guinea pig. The upcoming release of the plugin is pretty stable, but still in process. I’ve written in a filter to handle this, so if you’re willing to swap out your version of the plugin for this one, you can test the new filter.

    You can download the upcoming release from Github. Enough changes have been implemented in the plugin that you’ll need to replace all of the files in the /includes directory. (Warning: this release will change how term, custom post type, and the default featured images are stored in your database, so you might see unexpected behavior there, although I think you won’t. Also, rolling back from this version will definitely cause issues, if you decide to try it and have issues with it. Which I don’t think you will, but fair warning.)

    Once you’ve moved to this version, you’d want to add something like this to your functions.php file:

    add_filter( 'display_featured_image_genesis_do_not_move_titles', 'rgc_do_not_move_titles', 10, 2 );
    function rgc_do_not_move_titles( $post_types ) {
    	$post_types[] = 'post';
    
    	return $post_types;
    }

    And leave the “Do Not Move Titles” setting unchecked on the plugin settings page. If you check it, then the titles will not overlay the image sitewide, whether you have the above filter in place or not.

    If you try this, please let me know how it goes–it’s working for me here, but always good to have extra feedback.

    Thread Starter mammothca

    (@mammothca)

    Hi Robin!

    Gotta love DesktopServer, cloned site to test!!! Ok, I swapped plugin file for the updated dev version on GitHub. There doesn’t appear to be any usability issues and my custom css is still applied. Implemented the function to remove title from post page, and it did work, however… it is also removing the title from the main posts page.

    I would like the overlay title to work on all pages including the main posts page, but not overlay titles on individual posts.

    Sorry I should have been more clear, but I didn’t think of this until I tested, and noticed it.

    Thanks for your assistance!
    Doug

    Plugin Author Robin Cornett

    (@littlerchicken)

    Well, you can definitely experiment with the filter, and see what works. I think you can limit it to single posts, and it won’t affect the blog page, category/tag archives, and pages, if you tweak like this:

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

    (note that all I’ve done is wrap 'post' in an is_singular check) This seems to work for me, although I haven’t poked around much. Glad the updated version is working ok–thanks for letting me know!

    Thread Starter mammothca

    (@mammothca)

    That worked perfect! Time for me to start improving my php skills. Thanks so much for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Only overlay page titles, not post titles?’ is closed to new replies.