Try this:
add_action( 'template_redirect', 'wpse_124609_remove_titles' );
/**
* Move or remove some post titles.
*/
function wpse_124609_remove_titles() {
if ( is_front_page() ) {
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
} else if ( is_page() || is_single() ) {
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
add_action( 'genesis_after_header', 'title_slider' );
}
}
/**
* Add Title Slider to some post titles.
*/
function title_slider() {
echo "<div class="main-title-bg">";
the_title( '<h1>', '</h1>' );
echo "</div>";
}
Related Posts:
- How do you output custom code between posts in the loop?
- Impossible to get Attachments Outside WordPress?
- How to insert content from another Custom Post type into Post?
- WordPress Genesis custom taxonomy archive shows 3 repeats of each post
- Custom Post Type Loop throws 500 error when used in widget
- Conditional Query of Custom Post Type and custom taxonomy
- List custom taxonomy specific to one custom post type
- Conditional for a Single Post That Belongs to a Category?
- Add an Outside Wrapper to my Header and Make it Full Width
- Displaying multiple post types on home page
- Query to get child pages of current page and display it in action hook
- Custom Post type content within a slider
- Add Class according to the order of appearance
- Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis
- WordPress next post by ajax call on button click
- My post loop needs to have 8 different post templates
- CPT: multiple loops with different terms
- Custom Pagination based on Custom Post Type
- WordPress query posts by custom post type not workng
- How to keep a CPT stick to specific position?
- Turn post into simple slideshow
- WP_Query orderby modified to include custom meta changes
- How inefficient is it to use a Custom Post for 4-5 sentences & pull all to 1 page?
- Am unable to reset a query properly
- get_attached_media() on author page not working
- How to make sure content doesn’t display if selection is empty
- Show one item per category of a custom post type
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- How to check post type (to include custom css)
- Meta Key Value in current-user-only loop
- How to display all posts from standard posts to custom post types in a loop with pagination?
- How to customize a permalink (URL) structure?
- Calculate all custom field values in the post loop
- CPT + CMB2: data not displaying for only first post in loop
- Plugin: register custom post types, child ready and performance best practices
- Display only one post each WEEK
- Get next and previous 3 posts in a term in single post page
- Problem with WordPress query on page using custom fields
- How to Mass Delete Images from Media Library
- Loop custom taxonomy to get lists of cutom post types?
- How do i calculate the total of values of custom fields in custom post types?
- Multiple Loops On Custom Post Type Template?
- Permalink structure by Post Meta value
- Custom loop with multiple taxonomy queries
- I would like to have different styles for my posts based on the content of each post
- How to integrate video slide using custom post types?
- Checking if Post Title is Unique as Loop Criteria
- Custom post type not displaying content from single-{custom post type} page
- Register widget only page is a singular of custom post type
- Custom post type multiple loop by taxonomy term
- Is there a conditional tag to determine whether the post is _any_ custom post type?
- A question on creating filters for custom posts using taxonomy
- will post_id ever change? Can I safely use post_id for custom queries?
- Define new user capability for custom post types?
- How to allow visitors to enter custom post type?
- Show a Category X’s custom post type on Category X archive page?
- Paging doesn’t work?
- Is it possible to create relational metabox values in a custom post?
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- Meta query for custom post type ignored in main query
- Sort by alphabetical order archive.php page
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- Custom Tag Description unable to display just below and outside of the Loop
- 2 Templates 1 custom post type according url
- How do I move/order posts with a tag to the end?
- changing meta value and meta key of price field
- Display all taxonomy terms, add class if term applies to current post
- WordPress sort search results by custom order
- Return the latest post from a custom Taxonomy and Post Type
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Hide parent categories when clicked, and show it’s childs
- Custom Path/Folder behind a custom post type
- Group CPT posts by custom taxonomy
- Time based access control of custom post types – what is good approach?
- Show titles, date of all posts on single category page
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Best way to style first post differently?
- A to Z List of Custom Post Type in three columns
- delete_published_posts does not work
- Custom post type, organized by categories
- How to start a new post with custom Taxonomies already set?
- What’s the WP way to load remaining custom posts?
- WooCommerce sort products by the actual product width(not the shipping width)
- Create a custom php page and load it at a specific slug
- Structure of data : CPT + terms
- How to handle paged param in post and custom-post-type?
- Default text in a specific post type, but not visible?
- Update postmeta Parent when post_status child change
- WP Query with categories only shows one post and ignores the category
- What to and how to proceed with CPT to make DB small and efficient?
- WP_Query custom post type query not showing the exact post type
- Post ID randomly printing on page
- A custom post within a custom post
- Display Custom Taxonomy Alphabetically
- Full Custom Post Type List Organised by two Taxonomies
- Displaying Custom Posts on a Page
- Shortcode not working with post counter
- Shortcode to display Staff post type based on Location post type and Specialty post type
- Problem: wp_query outputs all images on site