Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?

This is due to the wp_nav_menu parameter fallback_cb: If the menu doesn’t exist, a callback function will fire. Default is ‘wp_page_menu’. Set to false for no fallback. You have not specified an alternative, so it uses the default, wp_page_menu. You could create your own function to display a page menu with the proper markup, or … Read more

How to store the_post_thumbnail() value in a variable

With a tiny bit of research, I’m pretty sure you could have created this yourself: $featimage = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘full’ )[0]; $printable_url=”<img src=”” . $featimage . ‘”>’; echo $printable_url; Edit: Since PHP 5 is defunct, you can reference the first node in the array ([0]) directly. No need for intermediate storage of the full array.

white spaces on the all sides [closed]

Your css file clearly shows a max-width of 1020px it appears as if your zoomed out or just on a large screen from your screenshot. If your window is bigger then 1020px then obviously there would be white space on either side. .container{ width: 100%; max-width: 1020px; margin: auto; } Also important to note this … Read more

How can I fix my pagination?

You need to add the paged parameter to your WPQuery: $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1; $query = new WP_Query( array( ‘posts_per_page’ => 5, ‘paged’ => $paged ) ); Here are the docs.