Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get_posts category

$defaults_param = array(
				'numberposts'      	=> -1,
				'post_type'        	=> 'post',
				'category' 			=> 40 ,
				'suppress_filters'	=> false
			);
$get_featured_post = get_posts($defaults_param);
Comment

Get wordpress posts by category name..!

<?php query_posts('category_name=CATEGORYNAME&showposts=5');

while (have_posts()) : the_post(); ?>

the_title();   // To display the title of all posts that have category name selected 

the_content();   // To display the content of all posts that have category name selected 


<?php endwhile; ?>
Comment

PREVIOUS NEXT
Code Example
Php :: insert multiple rows laravel 
Php :: php function uppercase first letter 
Php :: create multiple session in php 
Php :: Entity of type "DoctrineCommonCollectionsArrayCollection" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager? 
Php :: check if host is local in php 
Php :: how to loop with while in php for array associative 
Php :: generate random string in php 
Php :: how to get woocommerce order details 
Php :: laravel route match 
Php :: php check if all values in array are equal 
Php :: config file php 
Php :: php passing variables axios 
Php :: check if date has passed php 
Php :: laravel latest from relationship 
Php :: laravel 8 register with email verification 
Php :: config clear without artisan 
Php :: qr code generator php 
Php :: remove last comma from string php foreach 
Php :: Remove revisions from Wordpress pages 
Php :: laravel constract method 
Php :: Laravel - Query Builder Left join 
Php :: run laravel cron job on cpanel 
Php :: convert multdimentional array in array in php 
Php :: array to string conversion php 
Php :: print in file php 
Php :: how to make a json request in php 
Php :: ?? Null Coalescing Operator PHP 
Php :: drop table phpmyadmin 
Php :: symfony messenger 
Php :: run laravel seeder 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =