Loop inside page template not working

From https://wordpress.org/support/article/creating-a-static-front-page/, Posts Page: (if not already created) create an empty page. Give it a Title that will be used on top of your posts list. This step is mandatory as you are modifying the WordPress default setting. Any other content other than Title will no be displayed at all on this specific page. So, … Read more

Google Plus One script has quit working, now returns red flag

Google +1 is very easy to add to your site, you only need 2 things for a basic button. 1. Google’s JavaScript, make sure its is https not http! `<script type=”text/javascript” src=”https://apis.google.com/js/plusone.js”></script>` To add this to your site in your functions.php you can write, function google_plus_gp() { wp_register_script( ‘google-plus’, ‘https://apis.google.com/js/plusone.js’); wp_enqueue_script(‘google-plus’) } add_action (‘wp_enqueue_scripts’,’google_plus_gp’); 2. … Read more

What is the advantage of using home.php over index.php for the front page

If you look here [is_home vs is_front_page] you’ll see that is_front_page() is true regardless of what the homepage is set to in the WordPress settings. This means that if you don’t plan on releasing this publicly (i.e. short-run usage) then just having a front-page.php should suffice. is_home() is set based on your blogs page (which … Read more

Allowed memory size of (…) exhausted

Turns out this issue was caused by bad code (a missing assert) in my theme. More specifically the theme requires a custom navigation menu. As this menu hadn’t been created and assigned the site crashed. Why this caused an memory exhaustion error on my production server and not my development computer I unfortunately don’t know.

Problem dynamically generating an all purpose title tag

I wound up fixing it like this. All pages now work. But it looks …well …ugly. <?php if (function_exists(‘is_tag’) && is_tag()) { single_tag_title(‘Tag Archive for &quot;’); echo ‘&quot; | ‘; } elseif (is_archive()) { wp_title(”); echo ‘ Archive | ‘; } elseif (is_search()) { echo ‘Search for &quot;’.esc_html($s).’&quot; | ‘; } elseif (!(is_404()) && is_single() … Read more