Categories
CMS Development Wordpress

How to select from two different tables to display orders list with custom column from other table

I have a table which contains additional data about customers orders I want to create a table output on specific page when user loges in. when the user logs in I want to display to him all his orders + add column from another table using left join to column $order->get_id(). the id number has […]

Categories
CMS Development Wordpress

Print value of an array or variable in a payment plugin

I am programming a payment plugin for woocommerce, for the purposes of testing it I need to print the values of $response, I have treated withecho, print_r andvar_dump, but when I make the purchase process it does not print in any side. How can I do to visualize its content when buying a product. (After […]

Categories
CMS Development Wordpress

How can I get a link path to use for my resources such as JS scripts?

Is there a function that would return the equivalent of plugin_dir_path but it being agnostic of a plugin / theme? JS scripts need to be enqueued as resources, as such, you cannot include their on-server path which is, say /var/www/html/wordpress/thing/thing2/script.js, it needs to be the http://www.example.com/thing/thing2/script.js counterpart.

Categories
CMS Development Wordpress

Getting categories of posts under a custom taxonomy

I have a CPT with the following taxonomies: category, taxonomy_1 and taxonomy_2 (the last two are non-hierarchical). I want to get programmatically all the categories of the posts that are under taxonomy_1. I’ve tried the following without success: $args = array( ‘meta_query’ => array( ‘key’ => ‘taxonomy_key_in_CPT’, ‘value’ => ‘value_of_taxonomy_key_in_CPT’, ‘compare’ => “=”, ) ) […]

Categories
CMS Development Wordpress

WP Rocket Cache Lifespan – Never clear cache? [on hold]

Recently I’ve installed WP Rocket. Works good but even if the cache lifespan option is set to 10 hours it actually never really clear the cache and caching files are growing each day. When I clear cache manually, from Dashboard, it works, but it is never cleared by cron, as it should. I’ve tried to […]

Categories
CMS Development Wordpress

including file with its own body tags into a page template

I have a file being included into a custom page template, that has its own opening/closing body tags. The page template starts with get_header which contains the opening body tag and ends with get_footer which contains the closing body tag. Is this ok to have body tags from the included file, being included within the […]

Categories
CMS Development Wordpress

is there a way to link one of the field in ACF field group, to a field in a media attachment page? [on hold]

so i created a post type that will allow user to enter Basic Information such as patient id and full name. and since they’re allowed to upload pictures in the media page, i would like the user to be able to differentiate which picture belongs to which patient by entering their id in the field […]

Categories
CMS Development Wordpress

Order by two meta keys

I have this code which works fine: $args = array(‘post_type’ => ‘brands’,’meta_query’ => array( array( ‘key’ => ‘br_type’, ‘value’ => ‘Aviation’)),’posts_per_page’ => -1,’meta_key’ => ‘br_name’,’orderby’ => ‘meta_value’,’order’ => ‘ASC’,’fields’ => ‘ids’); However, I need to order first by ascending order by another custom field “br_category” and then by the name br_name. I am not sure […]

Categories
CMS Development Wordpress

js file in root loading without

This is my first time using a js file. It controls the hover and display of images in a php menu file. They are both in the root directory. I have not referenced the file in the menu.php file at all as I have only learnt of this now, and yet somehow it works. Do […]

Categories
CMS Development Wordpress

How to show jquery popup only in one page?

i have this jquery popup but i need to show it only in the homepage. Here is the code: $(document).ready(function(){ $(“#thover”).click(function(){ $(this).fadeOut(); $(“#tpopup”).fadeOut(); }); $(“#tclose”).click(function(){ $(“#thover”).fadeOut(); $(“#tpopup”).fadeOut(); }); }); Thanks in advance.