wordpress php get theme directory code example
Example 1: wordpress get domain
// WORDPRESS GET SITE URL:
echo get_site_url(); // echo's http://www.yoursitename.com
Example 2: get theme folder path in wordpress
echo get_stylesheet_directory_uri();
Example 3: get theme path in wordpress
include( get_template_directory_uri() . '/includes/my_file.php' );
Example 4: get post index wordpress
<?php $i = 0; while ( have_posts() ) : the_post(); ?>
<?php
//do something
$i++;
?>
<?php endwhile; ?>