Categories
CMS Mastering Development Wordpress

Allowing SVG uploads in media uploader without plug-in

I have previously managed to utilise this block of code within my functions.php file to enable and create thumbnails for SVGs that are uploaded to my site: // ALLOW SVG function add_file_types_to_uploads($file_types){ $new_filetypes = array(); $new_filetypes[‘svg’] = ‘image/svg+xml’; $file_types = array_merge($file_types, $new_filetypes ); return $file_types; } add_action(‘upload_mimes’, ‘add_file_types_to_uploads’); function common_svg_media_thumbnails($response, $attachment, $meta){ if($response[‘type’] === ‘image’ […]

Categories
Apple User Help

Macbook Pro headphones port won’t pick up my microphone

Proud owner of a Macbook Pro: MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports) Processor: 3.1 GHz Dual-Core Intel Core i5 Memory: 8 GB 2133 MHz LPDDR3 Graphics: Intel Iris Plus Graphics 650 1536 MB I have a Rode Videomic microphone with a three pole 3.5mm jack on the end of it. I plug this […]

Categories
CMS Mastering Development Wordpress

How can I use wp_query to show all product attributes using just the products ID?

While on a product page (product 1), I am trying to pull through information about a different relevant product (product 2). To create a kind of ‘you may also like’ list of products. I am trying the simplest of WP_Query but cannot figure out how to pull through all the product attributes from one product […]

Categories
CMS Mastering Development Wordpress

Custom WP_Query not acknowledging search category & tag at the same time, but work independently

I have elaborate search functionality on one of my sites, it is using a custom WP_Query that will allow for an ‘AND’ & ‘OR’ relation between the users selections. It will then generate the result and overwrite the existing products in the product list. This is all being done using AJAX and a function within […]

Categories
CMS Development Wordpress

WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank

I have created a rather complex WP_Query, I need to restrict the arguments that are used within the query dependant on the users inputs. I appreciate I can wrap the whole argument in an IF statement, however if I try add an IF statement within the arguments, it breaks the website claiming there is a […]

Categories
CMS Development Wordpress

WP_Query | Tax_Query Relation | Unable to use ‘OR’ as it then allows all products, help me finish my query?

I began slightly baffled and have slowly degraded to slightly going insane as I am building this wp_query. Admittedly it is a very complex query and there is a lot of additional code that has brought me up to this point so here is the code that is key to helping me resolve to an […]

Categories
CMS Development Wordpress

How to run WooCommerce pagination from within functions.php

I am building a very elaborate pagination script, the only piece I am missing is having the ability to run the in-built pagination from within the functions.php file. While within the functions.php file. How can I build the pagination? I use this code within the functions.php file: $the_query = new WP_Query( $args ); if ( […]

Categories
CMS Development Wordpress

Advanced Custom Fields | Help me link to a variable

I am struggling with appending a variable created using my Advanced Custom Fields into an OnClick attribute within a link I am creating. I simply wish to create a link that also triggers an OnClick. The OnClick’s purpose is going to be to trigger a script which tracks where users have engaged with the page […]

Categories
CMS Development Wordpress

wc_get_template_part( ‘content’, ‘product’ ) | Where is this file located?

I seem to keep going in a loop trying to find an example / answer / resource on this. I have built a custom WooCommerce homepage in /theme-name/woocommerce/archive-product.php where I use this snippet to output products: $display_count = 9; $page = get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1; $offset = ( $page – […]

Categories
CMS Development Wordpress

ACF Advanced Custom Fields | Help me grab the fields on my WooCommerce homepage

I cannot for the life of me (having tried about 30+ ways to get this working), figure out why these fields are not pulling through. It is exactly the same as all of the other times I have used the brilliant (but frustrating) plug-in. Here is my code: <?php $has_homepage_side_points = get_field(‘has_homepage_side_points’); $homepage_side_points = get_field(‘homepage_side_points’); […]