Page 1 of 1

wordpress PHP syntex ?? what kind of php syntex is this ?

Posted: Sun May 29, 2016 8:40 am
by gautamz07
Hey guys i was just going thorugh the syntex for php used in wordpress and it looks like below:

Code: Select all

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

          <article class="post">
            <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
            <?php the_content(); ?>
          </article>

      <?php  endwhile;

        else :
           echo "<p>No content found</p>";

    endif;
I saw the above code when i was just going through this tutorial vedio here https://www.youtube.com/watch?v=AShql_A ... i5&index=4.

is that some custom php syntax ? or something thats only done in wordpress ?

Thank you.

Re: wordpress PHP syntex ?? what kind of php syntex is this

Posted: Sun May 29, 2016 9:25 am
by requinix
PHP doesn't have custom syntax. Everything you see is either regular (albeit uncommon) PHP syntax or calls to WordPress functions.

Re: wordpress PHP syntex ?? what kind of php syntex is this

Posted: Mon May 30, 2016 5:05 pm
by gautamz07
Thank alot requinix :)