The easiest way would be using CSS, so you don’t have to change the PHP. Assuming you have a or some other wrapping element that contains all your posts, you could use something like
.main-content.span12 img {
width:50%;
height:auto;
}
.main-content.span12 h4 {
font-size:1em;
}
.main-content.span12:first-child img {
width:100%;
}
.main-content.span12:first-child h4 {
font-size:2em;
}
:first-child
will get only the first child of the parent element – so it will apply to only the first <div class="main-content span12">
.
Related Posts:
- ZIP up all images displayed in a [gallery] and offer as download link
- How to use “Add link” pop up for a WordPress widget
- How to validate XML-RPC post creation and cancel when needed?
- the_author() returns empty string
- Custom permalink structure only for default posts
- Add a new post status in the post progression
- List latest posts in WP-Admin
- Email admin when post pending?
- How to control which category will be picked for the slug of a post?
- How to hide the Text Area in the Post Edit screen
- WordPress Number of Posts Not Changing With posts_per_page
- Adding a Nav menu to post admin
- Comments enabled, but disabled at the same time
- Mass Update lines of code for all posts
- set role specific screen options in post summary page
- How to get a nofication when post submitted
- How to link up “read more” on excerpts hack from WP Recipies
- Any idea why wp_insert_post is succeeding but not returning?
- get custom image size
- Does an article (post) id ever change?
- Check is_single() outside loop
- Get Posts via Taxonomy Term Name with Space
- Change default Posts page
- Create post for every user?
- Facebook Share Thumbnail
- Auto “expire” all of an authors posts on spcific date
- How to pass Post_ID variable from theme’s Single.php to custom Plugin using AJAX
- Yearly archive page for future year
- How blog page in WordPress works : blog page retrieve first post ID
- Restrict users post for himself
- Driving a random quote like functionality with database
- Custom WordPress Theme: Publish Date and Display Date for posts right beside each other
- How to change permalink on post click on post listing page
- current post with current author
- Addition Text to Post Titles (Custom Post Types) in RSS
- Why aren’t my posts/pages showing up in my WordPress Theme?
- Assign category to new post via URL
- Blog post per page setting conflicting with custom WP_Query?
- Show certain posts in a LIST format that members have been granted access to
- WordPress Rest API Create Post
- How could I change my Permalink from blog to custom structure? [closed]
- WP Admin register taxonomy and post type performance
- How to get the last selected media alignment setting?
- Send post id through ajax and get the post content back
- How to make multiple sections in home pulling posts category wise?
- Permalink doesn’t get displayed in Twitter button (Local WordPress problem?)
- Highlight static blog page link in header
- What file is the standard frontpage that lists all the posts?
- wp_insert_post_data: Limit number of Page but Post get affected
- Is there any upper limit for the number of posts that can be created with wordpress
- Possible to add a statement to a core file?
- older blog posts not showing in new theme
- Is there any way to stylize articles one by one?
- get_children returns older images
- How to display post title inside thumbnail?
- Exclude post category in a blog page
- Banner appearing on Pages but not Posts; call it conditional confusion
- Single post full screen template not inheriting WordPress role permission
- how do I get the title in the post [closed]
- Publish a Silent Post without updating Feed
- How to display a single(current) post from a category
- Delete post from admin but not from database
- Open a wordpress single post in a lightbox without the header and footer
- how to create a sub section in posts
- Filter out posts based on a certain post_meta on the WordPress REST API
- Edit post & page option does not display on latest wordpress
- Separate top level categories on archive-product.php by meta
- How to add text before post_excerpt in Gutenberg
- While loop in functions.php outputting the_title() of each post on frontpage
- Pinterest button shows image options from different posts
- Execute php after post save/update
- allow user to create a draft post but not publish wordpress
- Ignore posts content in the posts queries for internal linking
- Comments are in database, don’t show up in WordPress backend or frontend
- Many buttons not functioning in WordPress dashboard (as admin)
- Is there a way to save different data when USER interacts with the same POST?
- WP_Query that targets all categories
- Fill the exclude array() in get_posts()
- Prevent WordPress from putting around specific element
- How to put the WordPress blog into theme
- How to correctly escape data
- How to fetch posts that are stored in the different table than the default table (wp_posts)?
- Sort Events by Venue Title – Sort Post set by related post ids
- Custom layout manager for posts
- Get posts by category or author
- How to make post button to a random post
- I moved my site to another server, wp admin works so does the front page, but posts don’t work
- How can I have the posts from one word press blog show on the presentation page of another word press site
- Where is object, property or label in the database that controls the order of the posts being displayed?
- How to pass multiple checkbox values to wordpress query?
- How to create three columns from selected posts
- Display the popular tags by default in the backend post edit page (without having to click on the link that displays them) [closed]
- How to get single post by one author?
- Getting 404 when using rewrite rule for posts
- Posts and pages not getting published
- How to create a post based on data in a table?
- how to show all post with its contents
- Last updated post in wordpress homepage first position
- How to make category for word post_content
- How does WordPress add the comments and comment form to posts