A code that I could not fully grasp related to foreach & count_user_posts()

Those parameters are optional, as the codex states: $post_type (string) (optional) Post type to count the number of posts for. Default: “post” So it’s optional, not required. If it isn’t passed in, then the default value is “post”. Optional parameters are a part of PHP, e.g. function print_number( $number=5 ) { echo $number; } print_number( … Read more

Bootstrap grid while loop

Your while loop means, “Every time I have one post, output the following code.” Since you have 5 divs inside the while loop, you are getting 5 copies for each post. So, change your while { } code to this, which will output just 1 div for every post: while($blogposts->have_posts()) { $blogposts->the_post(); ?> <div class=”col-md-6″> … Read more

Where does php code to load data go?

Thing is, the code can go to many places. For me, personally, is to develop own plugin and add code there. If you need to something execute at certain point, use add_action hook. From what you wrote, this question might be helpful: add_action hook for completely new post?