create shortcodes for posts

Your shortcode name and shotrcode_function_name are dynamic i.e vary with post name, which cause problem if you have same post title for two post. Also, you may not know or may be confused what shortcodes are available. I recommend to do this if your post title will always be unique. while ($query->have_posts()) { $query->the_post(); $shortcodename … Read more

Can’t get LIKE to work with wp_query [closed]

When you set up the meta_query value like: ‘value’ => “‘” . $city . “‘”, it gets translated to LIKE ‘%\’ondon\’%’ in the final SQL query, which matches things like L’ondon’ or L’ondon’er but not London. But you actually want it to be like: LIKE ‘%ondon%’ – so you should do: ‘value’ => $city, EDIT … Read more

How to change text depending on the country

There are several plugins out there that help you to translate your site content. Though you could have googled that by yourself easily, look here to get a brief overview: https://premium.wpmudev.org/blog/top-6-translation-plugins-for-your-wordpress-site/ WPML is a very powerful translation plugin (not free), in your case qTranslate should be good enough and is easier to implement than WPML … Read more

table chaos since upgrade to 4.8

To follow up, I did some more research on what causes html corruption, and one possible answer is different versions of jquery being called by different plugins. So i installed “jQuery Updater”. This didn’t fix it, but it gave me the clue to toggle on/off plugins that use jquery. When I hit the 3rd of … Read more

completely confused with archive.php, category.php

You don’t assign category templates to pages. They are templates that will be used automatically when you view a category. Read the Template Hierarchy documentation. You’re using WordPress completely wrong. You don’t create pages for archives, they exist automatically.

Check WordPress size on disk

Why using a plugin for that? You can set a function to calculate the size of the 2 installations. The size of abc.com will include also the size of the other installation, but then you can subtract the smallest from the largest. $path = ABSPATH; $size = foldersize($path); function folderSize ($dir) { $size = 0; … Read more