How can I make an object available through the entire site?

Do not use globals. Ever. You don’t need your object everywhere. You need it only where your code is running. Globals are hard to debug, everyone can write to them or just delete them. Unit tests with globals are possible, but awkward. You have to change the global state for each test, ie. something outside … Read more

the_tags : can we insert a class

Yes, it is possible. <?php $post_tags = get_the_tags(); if ($post_tags) { foreach($post_tags as $tag) { echo ‘<a href=”‘; echo bloginfo(); echo ‘/?tag=’ . $tag->slug . ‘” class=”‘ . $tag->slug . ‘”>’ . $tag->name . ‘</a>’; } } ?> The code is from another answer on Stack Overflow, see here for the source and more info

height should be set to auto to avoid pixelation in the post thumbnail function

You can use a filter to remove height and width attributes from images, as explained in this CSS Tricks. Place the following in your themes functions.php file. add_filter( ‘post_thumbnail_html’, ‘remove_width_attribute’, 10 ); add_filter( ‘image_send_to_editor’, ‘remove_width_attribute’, 10 ); function remove_width_attribute( $html ) { $html = preg_replace( ‘/(width|height)=”\d*”\s/’, “”, $html ); return $html; }

Which PHP page is the Default Posts Page

home.php is the file in the WordPress template hierarchy which is used for the posts page. However, after looking at the Twentyseventeen theme code on GitHub, there is no home.php file provided which means the index.php will be used instead. Within index.php Twentyseventeen then uses get_template_part to seperate reusable sections of code. The most general … Read more