php - How to show page by order in Post Query Wordpress -


I want to show the page in a custom template. I use the Post Query Loop to show the page and it works. But I do not want the home page to be shown. And I want to show my pages according to the order of ordering. I order the pages. But I am not able to fix it.

  & lt ;? Php global $ post; $ Args = array ('posts_per_page' => 3, 'post_type' = & gt; 'page', 'command' => 'ASC'); $ Myposts = get_posts ($ Args); If (! Myposts below!): Foreach ($ myposts $ post): setup_postdata ($ post); ? & Gt; & Lt; Section class = "colon-1-3" & gt; & Lt; Div class = "wrap-col" & gt; & Lt; Div class = "box" & gt; & Lt; Div & gt; & Lt; H2 & gt; & Lt ;? Php the_title (); ? & Gt; & Lt; / H2 & gt; & Lt; Figure & gt; & Lt; Img src = "& lt ;? php echo get_template_directory_uri () ;? & gt; /images/page1_img1.jpg" alt = "" & gt; & Lt; / Shapes & gt; & Lt; P class = "pad_bot1" & gt; & Lt ;? Php echo flourishing ('20 '); ? & Gt; ... & lt; / P & gt; & Lt; A href = "& lt ;? php the_permalink () ;? & gt;" Class = "button1" & gt; Read more & lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Section & gt; & Lt ;? Php endforeach; ? & Gt; & Lt ;? Php else:? & Gt; Default data & lt ;? Php endif; ? & Gt;  

Can you please help me out of it?

I think you have a front page set in Settings> Reading, if so You should work for:

$ front_page = get_option ('page_on_front'); $ Args = array ('posts_per_page' => 3, 'post_type' = & gt; page ',' command '= & gt;' ASC ',' post_not_in '=> array ($ front_page),) ;

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -