php - how to display content in else part? -


I am using this code to print my post category. If there is a post in WordPress, it means that it displays the rank of the category otherwise it does not display your post here. I did not get the other part properly, it shows that the dark screen is coming. I want to display the other part correctly on my display.

  & lt ;? php if (have_posts ()):? & Gt; & Lt ;? Php rewind_posts (); ? & Gt; & Lt ;? Php while (is_pause ()): the_post (); ? & Gt; & Lt; div id = "post-& lt ;? php the_ID ();? & gt; & Lt ;? Php post_class (); ? & Gt; & Gt; & Lt ;? php get_template_part ('content', get_post_format ()); ? & Gt; & Lt; Div class = "clear" & gt; & Lt; / Div & gt; & Lt ;? Php timeline; ? & Gt;   

Help me solve this problem. Thank you ..

You use the following code to handle the else statement Can:

  & lt ;? Php if (have_posts ()):? & Gt; & Lt ;? Php rewind_posts (); ? & Gt; & Lt ;? Php while (is_pause ()): the_post (); ? & Gt; & Lt; div id = "post-& lt ;? php the_ID ();? & gt; & Lt ;? Php post_class (); ? & Gt; & Gt; & Lt ;? Php get_template_part ('content', get_post_format ()); ? & Gt; & Lt; Div class = "clear" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;? Php timeline; ? & Gt; & Lt ;? Php else:? & Gt; Hold your own code here ... & lt ;? Php endif? & Gt;   

As you will see, we only use else: and then endiff to hook it in another section please Do not I also added the and closing which was missing from your code.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -