Add an additional check for in_the_loop()
to only affect titles being output within the main query’s loop:
function add_dates_to_title_wpse106605($title, $id) {
if ( is_home() && in_the_loop() ){ // <-- added in_the_loop()
$time = get_the_time( $d = 'l, F j, Y', $post = $id );
return $title . '<br><small class="time">' . $time . '</small>';
}
return $title;
}
add_filter('the_title', 'add_dates_to_title_wpse106605', 10, 2);
Related Posts:
- Remove Archives in category title
- Twenty Twelve Theme pagination issue
- How to customize WordPress twentytwelve_comment function
- I can’t change the body background-color through style.css
- TwentyTwelve, where is the excerpt box in add new?
- TwentyTwelve child theme style.css?ver=3.8.1
- WordPress Twenty Twelve Child Theme. Removing default widgetized areas
- Remove Archives in category title
- Unregister mobile menu in twenty twelve not working
- How to expand picture to cover entire header area? (twenty-twelve theme)
- deleting replies on post previews on the homepage
- Change Font Size on Blog (Twenty Twelve)
- What font does TwentyTweleve use? (not as simple as it sounds)
- My theme is not showing up on any other computers
- Remove Open Sans from Twenty Twelve theme
- Insert HTML just after tag
- What is meant by __(‘page’,’twentytwelve’)
- How to get a different mobile menu than desktop menu in the twentytwelve child theme
- Plugin development without Theme adjustments?
- Call sidebar from a template
- Create a new template for twentytwelve
- Add post dates from child theme and change font size on homepage post
- Jetpack infinite scroll not working on Twenty Twelve [closed]
- TwentyTwelve child theme mobile menu not working
- Why does the Full-width Template in Twenty Twelve pack so many classes into the body class attribute?
- How do I set the featured image size on the single post?
- Front page should display only one category of posts including sticky post with custom featured post box
- Create an extra Widget Areas in WordPress TwentyTwelve
- Override the function twentytwelve_scripts_styles in a child theme
- Implementing the twentythirteen responsive menu in twentytwelve
- Twenty Twelve theme search returns Nothing Found
- Elements floating on top of each other when Resizing or checking site on mobile. Twenty Twelve
- two columns of posts on homepage, one of them “favorites”
- Switch from hover to click on Twenty Twelve Menu
- Can I use wordpress themes without wordpress?
- strange behavior with comment position
- How does the Twenty Twelve Navigation Bar work?
- magic “MENU” button under Twenty Twelve theme
- How to make content area in full width in Twenty Twenty-One theme?
- Add date before entry title in Twenty Twelve
- With over a page of content the footer remains where the bottom of the screen was at top scroll
- Twenty Twelve Widget Taking Space
- Logo is not being displayed in header (Twentytwelve)
- Change Twenty Twelve’s comment form in a child theme
- Search Form Not Working
- Is the front-page.php template reserved in wordpress twenty twelve theme?
- Inline-Table under TwentyTwelve not working
- Setting up Pagination with twentytwelve_content_nav
- Wanting to list all Post types under a common category
- change link of menu particular tab
- Twenty Twelve entry meta data – change and move
- Upgraded to 3.8.1 on wp-admin but unable to upgrade in godaddy cpanel
- Add Media + Quick Edit buttons not working
- Remove post author using child theme
- Which files can be replaced in a child theme?
- Template is different with and without comments
- TwentyTwelve child theme: Incorrect footer menu
- Animate.CSS with a child theme
- How to add excerpt in loop in Twenty Eleven theme?
- How to retain responsive navigation menu in twentyeleven child theme
- Call sidebar from a template
- collapse twenty twelve submenu in mobile version
- Javascript block in Twenty Twelve theme
- twenty twelve theme widgets not working
- Change Twenty twelve theme background color
- Twenty Twelve theme: remove margins
- Roll my own theme or customize an existing one [closed]