shortcode

Woocommerce custom product category dropdown issue

情到浓时终转凉″ 提交于 2019-12-02 16:32:54
问题 I am developing a child theme for the Storefront Theme. I use the Product Category Widget as a dropdown under the header which fits my needs perfectly, though I need the same (if possible) dropdown menu to show up on every Category Page, instead of just the Main Page. I am customizing this code which almost does it: /** * WooCommerce Extra Feature * -------------------------- * * Register a shortcode that creates a product categories dropdown list * * Use: [product_categories_dropdown orderby

How to create a shortcode/edit a function to solve the conflict between Bootstrap and wpautop in Wordpress

浪尽此生 提交于 2019-12-02 11:08:32
Following on from my previously unsolved question How to show Bootstrap Buttons inline instead of one per line in Wordpress Specifically? and after extensive research in this point, I found out that that there is a conflict between Wordpress and Bootstrap. Wordpress simplified the text editing process by introducing invisible line breaks < /br> after each line. When Using Bootstrap elements (e..g buttons) with Wordpress, a line break < /br> gets introduced after each button code, leading them to appear one button per line, likr this screenshot: The only solution I found (which appears as an

How to use wc_customer_bought_product function to check if customer bought product in an array

允我心安 提交于 2019-12-02 10:35:06
First of all, I am a beginner and new to php so please forgive my ignorance. I asked my first question on stackoverflow today and somebody was kind enough to provide a great solution, so I am giving this another try. I am trying to use a function to check if a customer bought a product inside an array of product ids as in his account pages when logged in I need to display a different menu if he bought product from array A or product from array B, array C, you get it. I would like to create a different function for each array of product ids and associate it with a different shortcode. I have

Woocommerce custom product category dropdown issue

妖精的绣舞 提交于 2019-12-02 09:45:39
I am developing a child theme for the Storefront Theme. I use the Product Category Widget as a dropdown under the header which fits my needs perfectly, though I need the same (if possible) dropdown menu to show up on every Category Page, instead of just the Main Page. I am customizing this code which almost does it: /** * WooCommerce Extra Feature * -------------------------- * * Register a shortcode that creates a product categories dropdown list * * Use: [product_categories_dropdown orderby="title" count="0" hierarchical="0"] */ add_shortcode( 'product_categories_dropdown', 'woo_product

How to modify page title in shortcode?

孤人 提交于 2019-12-02 06:29:37
问题 How do I modify a page title for specific pages in shortcode? The following will change the title but it executes for every page. I need more control over where it executes. function assignPageTitle(){ return "Title goes here"; } add_filter('wp_title', 'assignPageTitle'); Is there a way to call the above in a shortcode function? I know how to use do_shortcode() but the above is a filter. My goal is to modify the page title based on a URL parameter. This only happens for specific pages. 回答1:

Sort a Woocommerce product variations custom output by their price

蹲街弑〆低调 提交于 2019-12-02 05:00:59
问题 Bellow I have a custom shortcode function based on this answer code that displays a block of product data for both Simple products and each variation of a Variable product. The output of the variation blocks seems to be ordered by the ID of the variation itself. For example, this is a screenshot of the frontend output: Which you can see matches the order of the variation IDs (from smallest to largest) screenshot: What I would like is to sort the variations by their prices instead (NOT by

Adding 'sort by' drop down on custom page using woocommerce short code

﹥>﹥吖頭↗ 提交于 2019-12-02 03:08:06
I have created a custom page using woocommerce short code for product categories. At the moment, it's pretty sparse as I've only just started on the new site. I just need the default 'sort by' drop down element adding but have no idea how to do it. I found some code here >> Woocommerce, sort dropdown on shortcode based product lists and it certainly placed the drop down I need on the site (although I'd like it aligned left). The only problem now, is that it's displaying the products with enormous images and all in a single vertical column. I'm not a PHP programmer and am wondering if I've

Change markup in WooCommerce shortcode output

痞子三分冷 提交于 2019-12-02 01:16:06
Is it possible to use a WooCommerce shortcode e.g. [product_category category="appliances"] amending the markup to include a <div> tag around some elements? I know I can do this by duplicating what the shortcode does but that seems overkill just to add a wrapping <div> . I could do it with jQuery but don't want any delay in them loading. @Updated Yes this is absolutely possible. You can achieve this with something like that: if( !function_exists('prod_cat') ) { function prod_cat( $atts ) { extract(shortcode_atts(array( 'cat' => '', // category 'class' => '' // Optional adding class to <div>

Sort a Woocommerce product variations custom output by their price

随声附和 提交于 2019-12-02 00:04:52
Bellow I have a custom shortcode function based on this answer code that displays a block of product data for both Simple products and each variation of a Variable product. The output of the variation blocks seems to be ordered by the ID of the variation itself. For example, this is a screenshot of the frontend output: Which you can see matches the order of the variation IDs (from smallest to largest) screenshot: What I would like is to sort the variations by their prices instead (NOT by their IDs) from lowest to highest. Any help is appreciated. This is the current customized code that I have

Embedding Google Apps Script WebApp in WordPress Page

岁酱吖の 提交于 2019-12-01 13:04:51
I've done a great deal of research on how to workaround Wordpress's iframe restrictions and I've been able to get it to work using various plugins with common services (google maps, youtube, etc.). However, all of these methods have not worked for embedding one of my published webApps. My most recent efforts have been using this plugin . Here is an extremely simple 'Hello World' webApp that I would like to embed: LINK . I was unable to simply use that URL as the 'src' for the iframe so I embedded the webApp in this google site then viewed the source of that iframe which I found to be: <iframe