tag.php pagination and query_posts()

After some other attempts I Found the syntax solution I was looking for. Just sharing. <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts($query_string .’&posts_per_page=10&paged=’ . $paged); if (have_posts()) : while (have_posts()) : the_post(); ?>

Sort list of page templates a-z?

You can use ksort() function to sort the array of $templates = get_page_templates();. So the full code will be- <?php $templates = get_page_templates(); // Sort based on key ksort($templates); foreach ( $templates as $template_name => $template_filename ) { echo “$template_name ($template_filename)<br />”; } ?> Also see asort() if you need.

Editing Category Pages

First, be sure to set up a child theme – don’t edit the current theme unless it’s a completely custom one. Otherwise, whenever you update your theme, your changes will be lost. To do: Check what folder your current theme is in. As an example, say you’re using Twenty Nineteen – it’s in a twentynineteen … Read more

Adding country tags automatically

I’d recommend making use of this API: https://www.countryflags.io/. You’ll also need a list of countries and country codes. Download that here: https://gist.github.com/keeguon/2310008 Then, you can do something like this to register all of the countries to your custom post type’s taxonomy. (you only really need to run this code once) $countries_json = file_get_contents(‘/countries.json/’); $countries = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)