Add category_name or cat in your arguments (args) array.
<div id="mini_stream">
<ul>
<? $args = array(
'post_type' => 'post',
'posts_per_page' => 4,
'category_name'=>'html',
);
$loop = new wp_Query($args);
while($loop->have_posts()) : $loop->the_post();
echo '<a href="'.get_permalink().'">';
echo get_the_post_thumbnail($post->ID, 'category-thumb');
the_title( '<h6>', '</h6>' );
echo '</a>';
endwhile;
wp_reset_query(); ?>
</ul>
</div>
Related Posts:
- exclude multiple terms using get_terms() function
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Allow authors to post only in categories they create in WordPress
- Add custom field to attachments in a specific category
- How to Populate the list of custom post type categories
- Php string not working in WordPress Functions.php [duplicate]
- Problems with function on function.php
- Use template for posts with a particular category grandparent
- Check if Product is in a Specific Category in Functions.php
- Woocommerce – remove product from category
- get current product name in functions.php
- get post based on category chosen in drop down – The ajax method
- Swapping wp_dropdown_categories function with wp_category_checklist
- Pass Category Name, Description and Photo into variables to pass to jQuery
- How to pick the default selected value in wordpress dropdown?
- Get page that displays all children of taxonomy parent
- Dilemma of Populating all the categories in a drop down list
- Edit the_category (); for a hierarchical display
- How to get current post category details inside “loop”?
- Show all tags within a category?
- Post not populating for custom post type based on category selection
- Dropdown category field inside repeatable metabox
- Display Visual Composer shortcode if a post belongs in specific categories
- Get parent category name when only child category is applied to a product
- How to move a post from one category to another
- Notice: Undefined variable
- Hide a specific category title from displaying on site
- Populate Posts based on category selected using AJAX that means without page refresh
- All categories options or All categories not Populating
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- PHP get_category() function redeclared
- Get category id for a custom category and display it in a class
- Trying to see if page is category or single and displaying title with appropriate heading tag
- Displaying categories
- How to insert the first letter in uppercase [closed]
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- Exclude a category ID from the following function
- How do I change/modify the_post_thumbnail(); html output?
- Shortcode created to check language not works
- How to Remove Parents Category Permalink from Posts
- Listing all sub-pages?
- How can I default to all WordPress roles when parameter is not included in shortcode?
- Recent post display using shortcode
- How to speed up a wordpress function with multiple loops?
- How can I use wp_insert_comment to write a comment when a post is edited?
- How do you add customer capability after Woocommerce purchase?
- Add a class to the anchor tag on HTML5 gallery
- Conditional Header in wordpress
- Menu — How to add “current-menu-grand-ancestor” css class
- functions.php is being included twice, creating PHP fatal errors
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- How to put a variable in a instance in the widget
- get a simple array of all of the term names that exist in all taxonomies
- Show categories then when clicked on a category list all sub category and when clicked show all posts in that sub category
- Display a specific category of products in shop page and disable code for specific actions
- Removing “wpautop” (auto tags) only on certain pages?
- selected option if current category is the value
- Alert Bar section within WP loop is displaying even though there are no posts
- Is there a way to conditionally check whether a WordPress post title is empty?
- Echo a function inside a function
- Use WordPress function in php file
- wp_force_remove_style’ not found
- Include Parent Term in wp_list_categories
- is_user_logged_in() not working in AJAX validation call
- Pagination on Custom Post
- Assign category a default post type
- Convert the_permalink() function output into string
- Add meta tags to a custom header
- get_current_site() is undefined
- Function sanitize_title() does not appear to be working
- random display categories – change url
- writing an unique php function to be used on my website
- How to prevent a function from running based on host (ie web vs local)?
- Output product category link from WP_Query
- Adding onload to body for certain pages
- Delete images from media library when user deletes an image from ACF Gallery
- Counting number of posts in multiple (sub)categories using shortcode
- Reject all malicious URL requests functions.php
- Change wordpress’ database data using ajax – how to get current user id?
- Change category thumbnail size
- Best way to use variables in multiple functions?
- Multiple Tag Filtering
- Polylang and template files
- How to override WooCommerce Order Item Meta with data from Cart?
- Offset with ajax load more posts duplicates
- Custom content using in_category
- Need help with PHP functions
- WordPress styling recent post
- Break a WordPress function to run in patches and re-continue
- syntax error unexpected ‘}’ at 364 line
- get_post_meta no longer working
- Highlight posts currently being edited on multiple editor site?
- Assign new post author IF another user in custom field on post transition
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- How do I change the Go To Categories link in the term_updated_messages
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- Background Tasks in a WP Cronjob?
- Tags being Inserted in html from plugin PHP not passing through the_content
- Add/Modify rel=canonical of all the pages of a wordpress website
- Calling a PHP function from a menu item