Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6586429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:47:23+00:00 2026-05-25T16:47:23+00:00

I recently added post formats to my WordPress theme – on the blog page

  • 0

I recently added post formats to my WordPress theme – on the blog page its fine as they are all styled accordingly. However on my home page template I only want to show ‘standard’ posts formats (no links, galleries, audio, video etc.).

In my theme options I can decide how many posts to display on the front page which is what ‘dft_recent_number’ is for.

Does anybody know how I can change the code below to exclude all but ‘standard’ post formats?

<?php 
$query = new WP_Query();
    $query->query('posts_per_page='.get_option('dft_recent_number'));

    //Get the total amount of posts
$post_count = $query->post_count;

    while ($query->have_posts()) : $query->the_post(); 

 ?>

Any help is much appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:47:24+00:00Added an answer on May 25, 2026 at 4:47 pm

    WP_Query does not seem to have a straightforward parameter for post_format.

    From my quick research it appears that post formats are related through taxonomies. So, theoretically, using the taxonomy parameters should work.

    $args = array(
        'tax_query' => array(
            array(
                'taxonomy' => 'post_format',
                'field' => 'slug',
                'terms' => 'post-format-standard',
            )
        )
    );
    $query = new WP_Query( $args );
    

    Note: you’ll need to update the taxonomy names and slugs for your blog. This should be the names you set in your functions.php file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Facebook recently added photo-tagging capabilities to its Graph API: http://developers.facebook.com/blog/post/509/ I am using FbConnect
I have recently added a comments section to a blog. Codeigniter says to always
I've been making a wordpress theme recently and just now some of the code
I recently added jQuery mobile to my website. However, the jQuery theme broke my
I recently added a new mapicon_id field to my venue records which displays all
I recently added a feature to a large application written in Delphi (version 2009)
I recently added these lines to my ~/.bashrc file to show the current branch
I recently added CKEditor to my app and I would like to include my
I recently added a parameter to one of the method of a wcf. It
I recently added some url re-writing to my web application and had to added

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.