Since you add all the html in the post by hand, have you tried filtering the content?
Similar to WordPress’s <!–more–> tag, you could just add <!–my_headline_content–>
Then:
add_filter( 'the_content', 'my_headline_function_12378' );
function my_headline_function_12378( $post_content ){
/*
* get your recent posts' data. You'll find the code with a simple search.
* say $headline contains the headline html (link, addnl info, whatever)
* swap your tag with this headline
*/
$the_content = preg_replace( '/<!--my_headline_content-->/i', $headline, $the_content );
return $the_content;
}
Done.
Related Posts:
- showing all recent posts in theme
- How to filter content by language with WPGlobus
- Recent posts with comment count in “Sidebar” template [closed]
- Form to Add Posts to Custom Post Type
- How do I add settings to the Background Options Page?
- Import media to online WordPress from local development
- How to add a checkbox element to attachments editor with example
- Auto get_header and get_footer on every template?
- What is the right way to include a wp-admin file in your theme?
- Theme Check gives: Required: This theme doesn’t seem to display tags?
- Is it possible to use line break in theme description?
- Override Current Theme Setting in wp_config.php
- Theme showing incorrect update
- modify a output of a widget
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- changing Specific section background image in wordpress
- WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
- Which is the simplest theme for WordPress to use it as your base?
- How to highlight the current page in the nav menu?
- Is tag default in WordPress?
- Should I use language_attributes() or bloginfo(“language”) in html tag
- Getting jquery to work with custom theme
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Why does WP recommend against custom favicon functionality in themes?
- What’s the best action to use when you want to do something only once per theme setup?
- Excluding a page with a certain name from wp_page_menu
- Widgets with groups / sub widgets? Widget in a widget?
- Avada resources still loading from localhost after database migration [closed]
- No Appearance –> Header menu
- How do I create a custom partial / template?
- Internationalization and functions that use it
- Get a setting value conditionally in the Customizer api
- How should I be handling my theme version numbering?
- How would you accomplish the following advanced settings page?
- image url relative path not working in css file
- Update Custom Theme Version
- Storefront child theme not applying parent theme [closed]
- Sort wp_query by sum of two meta fields
- What can I use for small text when converting to WordPress?
- How to i style the elements from the TinyMCE
- Integrate WooCommerce theme with a WordPress theme [closed]
- Automated Footer information
- How do you use WordPress for a website that’s not in a blog format?
- Change the “Default Avatar” admin option via functions.php
- How to develop a menu like wwe.com?
- Add tags to pages
- Why set a second parameter in the translate function?
- How to escape multiple attribute at once in WordPress?
- Override plugin option by with a custom theme
- Replace site title with logo when logo is uploaded in customizer using
- Is WordPress a good option for this…?
- Review site using WordPress
- How to create query to get top 3 sticky/latest posts
- Fatal error: Class ‘ZipArchive’ not found
- Is it possible to determine when user is at “Media > Add New” vs “Post > Add an Image”
- What happens if a theme is no longer supported?
- Running a function on post update with new post meta
- Check if( selected() )
- Modify available templates (in dropdown)
- Is There A WordPress Hook for Accessing Attachments for A Particular Page?
- WP Customazation API doesn’t save the default Value
- Change WordPress Resource URL
- Adding content inside the anchor tags within WordPress main nav
- Sample Theme Options page for Multisite – what to consider
- How to use shortcode inside of shortcode in theme
- Search Form Not Working
- My contact form – I’ve changed the source code but the changes are not being applied
- Theme calling page.php instead of home.php
- Open portfolio image in light box
- Why do sticky posts show in this menu?
- Dot “.” in option value foobars save options function
- style variations hurt the editing performance
- how to create/register menu items that can be added to menus later
- WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
- How to properly use AWS SES for a contact form?
- No templates for condition page.php Elementor
- Use instead of for wp_nav_menu()
- Find out the reason that the Styles and scripts in the theme are loading properly in localhost but Not in server after deploying
- Theme does not allow shortcodes
- fetch all post from wp multisite network and sort all the post in descending order on the basis of “Created by ” term
- How to generate a rtl.css file for themes?
- How can i create my Onepage smoothscrool WordPress theme?
- What is the best practice workflow for new website overhaul and keeping current SEO ranking? [closed]
- Add a customize control depending wich radio setting is checked
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- Providing updates to your WordPress theme
- wpdb->insert adds too many rows
- wpalchemy repeating fields dropdown issue
- Does WordPress require that your submitted theme supports multiple menu levels?
- WordPress loop not working on blog.php page
- Option to show/hide widget depending on is_home?
- Add Dynamic Sidebar to Exisiting WordPress Theme [closed]
- Why does the first loop take arguments from the second loop?
- How do I middle-align my header menu items in WordPress [closed]
- How to add Dummy content when active wordpress theme without xml import?
- Is there any reason that other theme elements (such as nav menus) shouldn’t be within the loop?
- How to send async emails in wordpress?
- ways to create customized theme (hard coded – no pagebuilder)
- Can’t select my block by clicking on it on apiVersion – but using blockProps
- Webpack does not create or update index.asset.php file in build folder