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

show all posts from category

   <?php
    $args = array( 'category' => 7, 'post_type' =>  'post' ); 
    $postslist = get_posts( $args );    
    foreach ($postslist as $post) :  setup_postdata($post); 
    ?>  
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> 
    <?php the_excerpt(); ?>  
    <?php endforeach; ?> 
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 :: livewire pagination bootstrap 
Php :: format uang rupiah di php 
Php :: call metho din config laravel 
Php :: how to create controller in specific folder laravel 
Php :: wordpress disable errors 
Php :: how to calculate days between two dates in php 
Php :: carbon parse sunday 30 days ago 
Php :: ubuntu 20 phpmyadmin install 
Php :: php discord webhook 
Php :: php laravel xml to json 
Php :: two digits after decimal point in php 
Php :: php regex non capturing group 
Php :: php get all elements of array except last 
Php :: php redirect if not logged in 
Php :: get template part pass variable 
Php :: laravel latest() 
Php :: laravel throw exception with status code 
Php :: Check duplicate email in laravel using jQuery validation 
Php :: how to add data to the request object in laravel 
Php :: nova resource title function 
Php :: wordpress check if page 
Php :: php configuration 
Php :: phph get server protocol 
Php :: laravel plural and singular 
Php :: PHP auto refresh page 
Php :: laravel model relationship find soft deleted 
Php :: bind multiple data in one id in php using php using for loop 
Php :: Search for text in string php 
Php :: count child products for each parent Product laravel 
Php :: Cannot use object of type stdClass as array 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =