Hello!
For example, I have the following code in the template file index.php:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <a href="<?php the_permalink(); ?>"> <h2><?php the_title(); ?></h2> </a> <div class="custom"> <?php the_date(); ?> опубликовал <strong><?php the_author(); ?></strong> в рубрике <?php the_category(); ?> <?php the_content(); ?> <a href="<?php the_permalink(); ?>">Читать далее</a> </div> <?php endwhile; ?>
<? php endif; ?>
It does not matter what the code is, the main thing is that the output from the database is output. So, I want to understand how he does it? For example, I take the the_content () function and try, so to speak, to backtrack in advance how this works. But something I do not understand.
This is how traced, and all
./post_templates the_content() get_the_content() ./post.php get_post() class WP_POST ...magic... ./wp_db ...magic..
But I did not find the answer, I want to follow in the code straight from connecting to the database until the moment of output to index.php, i.e. How does the whole process of posting go?
Throw a material or in short the entire call stack. What happens inside WP classes? You are welcome!
With WP, it's only the 3rd day, please forgive me if the question is stupid!
Thanks in advance for any answer!