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
- How do test if a post is a custom post type?
- How to create a custom search for custom post type?
- How do you use a CPT as the default home page?
- Can a custom post type have a Parent Page?
- don’t publish custom post type post if a meta data field isn’t valid
- group search results by post type?
- How to use a custom post type as front page?
- Display several random posts, but make sure a condition is met
- add_rewrite_rule and custom variable
- Fix custom query pagination without changing site-wide posts-per-page settings
- Randomly placed sticky custom posts complemented by blog posts
- Restrict categories to a custom post type
- is_page_template not working as expected
- Displaying custom posts only if custom meta box’s date is not expired
- Integrating Orbit slider into wordpress through custom post type
- Keep main articles and author blogs seprerate, News / Magazine like site
- How to create an advanced filter search?
- How to get all posts except for one post from a certain custom post type?
- Create a random unique 6 digit number as custom field for custom post type
- Placeholder in HTML editor text area?
- WP_Query | ‘post_type’ doesn’t work
- Filter by custom taxonomy slug on a custom post type
- Change or update WordPress loop based on dropdown selection
- Can I create a loop with multiple post types and specify different $args for each post type?
- How to integrate video slide using custom post types?
- Is there a conditional tag to determine whether the post is _any_ custom post type?
- Return the latest post from a custom Taxonomy and Post Type
- Show titles, date of all posts on single category page
- Full Custom Post Type List Organised by two Taxonomies
- Shortcode not working with post counter
- Allow users to create posts without logging in?
- pagination not working for category.php (custom post types in categories)
- Categorise Custom Post Types
- Custom Post Type single.php template only shows the latest post
- 3 random images from custom post type, each in a div with a diffrent class
- Shortcode leaves no space for other elements?
- Conflict between wp_list_pages and get_posts – list pages not displaying
- Showing taxonomy terms on custom post type
- How to export custom post type with ACF to individual file with automation?
- Different videos for different posts
- Display post from custom post type
- WordPress giving a 404 page when passing a year argument different than the current year
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Post visibility option to theme front-end for author to select?
- Permalinks for single-[custom-post-types] not working
- Drop down list with posts within the “add new” page
- Custom taxonomy not saving correctly
- How to show custom post type on homepage and in categories
- Can I get an auto-populated dropdown list of other custom posts in a custom post edit page?
- How can I loop at a Specific Taxonomy from a custom post type?
- Update query based on CPT / Post Type, show all sorted by date
- How to avoid duplicate posts queried from custom meta?
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- Why do my custom post type show up in all pages?
- Looping to organize and display custom posts by category using PHP and WordPress
- Pagination for a cpt filtered with a category
- Adding specific custom fields (images) to post excerpt
- How to add custom PHP code in post header?
- Mix Facebook and Twitter feed into custom posts
- Infinite scroll doesnt work
- Excluding category from loop not working
- Strange behavior on WP_query
- conditional based upon the count of current user’s published custom posts
- How to check if meta box value is false for all posts then do something based on that
- Tricky Custom post loop
- Custom metabox fields not saving when limited to a certain CPT
- Custom taxonomy page template
- display news with pictures 3 small and one large (loop)
- Selecting which pages to display custom post type on using checkbox
- Display posts from category in page
- Multiple Queries and Loops within CPT Archive
- Displaying information from Custom Fields in template with Types?
- Pagination not working with custom loop
- Is There A Way To Add Another Field To Custom Post Type (Not Custom Field/Meta)?
- Display multiple custom post type lists on homepage – multiple loops
- Query Custom Post Type by Tag
- Loops running into each other
- Display by tag from different post types
- How to display *block number* instead *date value* on WordPress posts?