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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

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

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

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

Post by requinix »

PHP doesn't have custom syntax. Everything you see is either regular (albeit uncommon) PHP syntax or calls to WordPress functions.
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

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

Post by gautamz07 »

Thank alot requinix :)
Post Reply