Unfortunately a site URL is nearly useless when only filesystem-level access provides the ability to see the PHP code. What is blog.php
, there should usually be no such file in a WordPress theme. The first two blocks of code I put above go into functions.php
directly (not within any functions currently in the file).
You don’t put that second block of code straight into the index.php
, you just put the line that refers to the post-loop.php
in alone, something like this:
<?php if (have_posts()) :
// loop to get posts from the database and display them
get_template_part( 'post-loop' );
?>
Remember that the contents currently between that if loop have been cut out and are the only contents of the post-loop.php
file you just created. You don’t have to do this last step, but doing it means you only have one place where the code to render posts resides which helps in later changes and debugging you may deal with.
I’ve been describing the way it is set up, and working, on my blog (https://alex.clst.org/dbd), so the code I’ve shared with you does work when implemented properly. Perhaps the div your posts render in isn’t content
, that may also screw things up. Look using the view source
or similar command in your browser to see what div the posts are thrown into and add that div name to the container
value of the first code block above.