Prikazivanje postova na homepage samo jedne kategorije

Pozdrav svima.

Trebam pomoć u vezi wp sajta, naime zelim na homepage da mi prikazuje samo postove iz određene kategorije ne zelim sve postove na homepage.

Tema je https://www.fabthemes.com/siren/
Hvala svima unaprijed :slight_smile:

Kod homepage-a ide

<?php /** Template Name: Homepage * The main template file. * * This is the most generic template file in a WordPress theme * and one of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists. * Learn more: http://codex.wordpress.org/Template_Hierarchy * * @package web2feel * @since web2feel 1.0 */ get_header(); ?>
		<div id="article-area" class="cf ">
		
	
			<div class="article-list ">
					<?php
					$count =ft_of_get_option('fabthemes_blog_number','3');
					$args = array( 'numberposts' =>$count );
					$lastposts = get_posts( $args );
					foreach($lastposts as $post) : setup_postdata($post); ?>
					<div class="grid-4">
						<div class="article-box cf">
						
								<?php
									$thumb = get_post_thumbnail_id();
									$img_url = wp_get_attachment_url( $thumb,'full' ); //get full URL to image (use "large" or "medium" if the images too big)
									$image = aq_resize( $img_url, 480, 300, true ); //resize & crop the image
								?>
								<div class="homegallery">
								<?php if($image) : ?> <a href="<?php the_permalink(); ?>"><img class="scale" src="<?php echo $image ?>"/></a> <?php endif; ?>
																
								</div>
						</div>
					</div>
				
				
					<?php endforeach; ?>
			
				
			</div>
	
		</div>



	</div><!-- #primary .content-area -->

<header id="masthead" class="site-header container-12 role="banner">
		<div class="top cf ">
		<div id="botmenu" class="grid-8">
			<?php wp_nav_menu( array( 'container_id' => 'submenu', 'theme_location' => 'primary','menu_id'=>'web2feel' ,'menu_class'=>'sfmenu','fallback_cb'=> 'fallbackmenu' ) ); ?>
		</div>
	</div>

</header>

			<?php web2feel_content_nav( 'nav-below' ); ?>
<?php get_footer(); ?>

Koristi neki plugin kao “WPBakery Page Builder Settings” i možeš da složiš preko njega kako god ti volja, ako ne želiš preko plugina imaš način kroz WP da ne diraš kod nego nešto kao ovo
[rpwe limit="5" excerpt="true" cat="72" ]
Ovdje ti pokazuje limit to je da će prikazivati 5 kategorija, CAT ti je ID kategorije za ostalo se snađi sam. Ima jako puno načina da se to odradi i jednostavno je bez programiranja to je ipak malo veći proces koji zahtijeva vrijeme i znanje.


Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Profit Monkey