Difficult to say how to implement it exactly without looking at your code. But the idea is to use the $wp_query->current_post
variable that is always available in the main query. It would look something like this:
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
global $wp_query;
if ( $wp_query->current_post === 0 ) {
// Output the first post
continue;
}
// Output post
}
}
Related Posts:
- Software for WordPress Theme and Plugin Development? [closed]
- How to detect mobile devices and present them a specific theme?
- Using wp_add_inline_style without a stylesheet
- Should we use get_template_part() in functions files instead of include_once?
- Reset positions of metaboxes in admin
- Add a dropdown to theme customizer
- design and development workflow
- How to control initial wp_head() output?
- enqueue script for specific shortcode
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- WordPress twentytwenty theme inline css overriding css body
- What is the problem if I use CDN in my WordPress parent theme(built using bootstrap)?
- How can I insert default widgets when my theme is activated (similar to what twenty eleven does)?
- Why might $input (Settings API) be coming through empty?
- add generated stylesheet from parent theme after child-themes style.css
- date_i18n() issue
- Creating Page Based on Category
- How to check if post has any tag?
- LOST in WP Template Hireachy
- Merging PHP download script into `functions.php`
- Should use widgets in this case?
- Changing the entire control choices using wp.customize with JavaScript
- Static Front Page problem
- Enabling Default Widgets in a Custom Theme
- Get last modified date for menu link
- A theme that follows all the best practices to learn from?
- get_post() function returns post even if it is trashed
- WordPress how to override function adjacent_posts_rel_link_wp_head() in link-template.php the correct way
- Can wordpress run in root of existing php site with no theme on index.php but all other WP posts/pages?
- How to regenerate thumbnails when they’re stored on S3
- customizing the_password_form filter
- CSS won’t style output of wp_nav_menu() correctly
- after_setup_theme, Global Variable and Theme Customizer
- How to make WP admin recognize a newly created child theme?
- searchform.php override not working
- Can’t show custom post thumbnail sizes as background images
- Load child template based on parent
- Theme translation not applying
- How to add filter the post thumbnail before save in database?
- Custom theme development additional pages
- How to add material design css in wordpress and woocommerce
- Timber: Get single image from media library with all attributes
- How to set the currently active page in the menu including parents
- changing blog title to an image using filter function in child theme
- page.php dependent sites are not working in custom woocommerce theme
- WordPress taxonomy and archive custom class
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Would to use AJAX to get an option from the database and use it in a jquery setup or is there an alternative to consider?
- How to remove text “Log In” from login page
- Website pagespeed problem
- Why are some of my menu items not displaying on my menu?
- Managing WordPress Theme
- Can’t use admin_enqueue_scripts or wp_enqueue_script
- How is the `get_sidebar` function meant to be used to call a 2nd sidebar?
- next_posts_link and previous_posts_link problem
- Data Validation in wordpress
- Gutenberg theme development: how to add “headers” option under styles > colors > elements?
- Localize script not working in ajax
- How to override template files in parent theme?
- How can i make multilevel menu in wordpress theme with bootstrap
- Remove div element generated automatically from theme [closed]
- Setting conditional background image from meta value
- How to Emulate Default Navigation Menu Behaviour in a Custom Theme?
- How to use the _S framework
- How to link to the page displayed by home.php?
- AJAX call fails when sending JSON but works with URL style string
- How to make excerpt image be full size instead of thumbnail?
- WordPress comments title
- How can I run code in functions.php when switch_theme() is called?
- How to get a random single category name in get_posts()?
- WordPress theme files Organization
- Default customizer colors aren’t displayed outside of the preview
- Put CSS Content inside tag for WordPress
- More HTML elements variety in visual editor
- How to display latest posts with authors image
- How can I convert a list of title-posts into a sequence of comma separated text? [closed]
- Is it possible to issue a theme update that requires a new plugin?
- Get property of non-object on theme activation
- change wordpress website logo url [duplicate]
- wp_editor some functionality not working on custom theme
- Update modified Shopify third-party theme [closed]
- Create new sidebars trough admin post/page metabox
- How one category can have different fields?
- How to add custom field option with menu?
- save prevision data in the database on theme activation
- adding navigation to genesis themes
- What causes a theme to be inefficient?
- How to defeat “Blog pages show at most __ posts” setting in the loop?
- pagination/prev and next page links not showing
- Admin bar is showing up to non logged in users
- WordPress jQuery is not defined error
- Upgrade to WP 3.2/ and Server to php5 breaks theme? [closed]
- on click load images on the same page [closed]
- Best practice to create required pages
- Multiple content areas with Gutenberg – Transparent areas mid content
- Is it possible to have two templates in an article hirearchy?
- Website Developer has gone missing! How to gain full access of your code from a WordPress website?
- How to fix wp-env: “error: Your local changes to the following files would be overwritten by checkout”
- Do core themes normally allow automatic upgrades?
- WordPress search field won’t get wider