Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore General Questions › Using code in the product description
Tagged: shortcode nesting, wp_audio
- This topic has 12 replies, 5 voices, and was last updated 13 years, 7 months ago by amin007.
-
AuthorPosts
-
February 22, 2010 at 8:17 am #836rboursawMember
I am trying to use the WP_Audio plug-in, which works fine within pages I create and even within a widget text box, but I cannot seem to get it to work within the product description of an item within the WPStore. I have been able to use standard HTML coding within the description, but cannot call on the [WP_Audio….] plug-in. Is this possible?
February 23, 2010 at 12:38 am #18340amin007ParticipantThose shortcodes are implemented using WordPress filter (this is how shortcodes were implemented before WordPress introduced the new shortcode functionality).
What this means is that when the page is filtered it doesn’t even see the shortcode that you have inside the shortcode so it doesn’t filter it.
So the simple answer is that you can’t do it but if you are up for some challenge then I can give you another shortcode implementation that uses the new shortcode functions of WordPress and I think you should be able to do the shortcode nesting (shortcode inside a shortcode).
February 26, 2010 at 4:48 am #18341rboursawMemberOk, what do I need to do? I’ve done a bit of C# over the years, how hard can it be? (famous last words… )
Thanks!
Bob
February 27, 2010 at 2:02 am #18342amin007ParticipantI added two new shortcodes in the WP eStore that will work when you add a shortcode inside the description field (shortcode nesting). I have sent you an updated version of the plugin… use one of the following shortcodes:
[wp_eStore_fancy1 id=1]
or
[wp_eStore_fancy2 id=1]
March 22, 2010 at 11:07 pm #18343J57MemberHi Amin I have been sent an updated version of the wpestore plugin by Ivy from tips and tricks HQ. I am trying to do the same thing – embed the wp audio shortcode of a file in the product description field. I could really do with your help. The shortcode works fine when used directly in a post.
http://rickykalsi.com/clcwebsite/?page_id=21
Kind regards
J57
March 23, 2010 at 8:03 am #18344amin007ParticipantIs the shortcode created using the wordpress shortcode function or was it done using content filtering?
Shortcode nesting should work fine as long as they have been implemented correctly.
March 25, 2010 at 2:18 pm #18345rickyMemberHi Amin
I am using the following audioplug-in ( http://wpaudioplayer.com ) and used the wordpress “add media” option which then gave me the following code [audio:http://rickykalsi.com/clcwebsite/wp-content/uploads/2010/03/TESTMP3.mp3%5D. This is the code that I pasted into the description field of the product. I do not know anything about content filtering or any options relating to it.
I hope i have provided enough information to solve this query.
Thank You Amin
J57
March 25, 2010 at 2:25 pm #18346J57MemberHi Amin
Just to let you know J57 and Ricky are the same person – i had two accounts with this forum.
Thanks
J57
March 26, 2010 at 7:14 am #18347amin007ParticipantI had a look at the code of the “audio plugin”. It doesn’t use the WordPress shortcode API to create the shortcode.
http://codex.wordpress.org/Shortcode_API
Please note that shortcode nesting will only work when the proper WordPress API was used to create the shortcode (Just calling is a “shortcode” doesn’t make it a proper shortcode).
March 26, 2010 at 9:35 am #18348J57MemberHi Amin
Thank you for taking th time to take a look at this for me. You must be a wordpress lengend in your office!.
Two Questions :
1. Do i need a plug that uses the WordPress API? if so do you have recommendations?
2. Are you able to show me / explaine how to use the wordpress API to generat ethe necessary code? I am now enetring a teritory that i have no undersrtanding of though i am willing to learne and try (sorry i had a look ath e content page of the link and was left confused ).
I really appreciate your help so far.
Thank You
March 27, 2010 at 2:31 am #18349amin007ParticipantIf you want to use shortcode nesting (e.g. one shortcode inside another) then you need both the plugins to use proper WordPress Shortcode API.
Creating a shortocde using the WordPress Shortcode API is pretty easy.. all you have to do is use the “add_shortcode” hook and specify a handler function so WordPress knows what to do when it finds that shortcode in a post or page.
Try requesting the author of the plugin you are trying to use and see if he will implement the shortcode using proper WordPress shortcode API.
April 5, 2011 at 1:18 pm #18350mtsw69MemberHi, I’m wanting to use audio player shortcodes in product descriptions, and I understand that using one of the fancy tags will allow nesting, but what if you’re using the Display all products in a given category shortcode? For example, I have a category called Horror, and within that I have 5 products which all have audio previews. I set up a page called Horror, and used the display all products tag on that page so when users click to it they see all the Horror products. Each product has a description which is where I want to use the shortcode, but when I try that, I just see the shortcode, not the audio player.
The option you mentioned in previous posts seems to require me to specify a particular product in the tag, rather than all products from a given category.
April 6, 2011 at 12:44 am #18351amin007ParticipantThere is a proper shortcode version to display all products:
[wp_eStore_show_all_products style=1 order=1]
You can use this shortcode if you get the Extra eStore shortcodes plugin from here:
http://www.tipsandtricks-hq.com/ecommerce/wp-estore-shortcodes-and-functions-reference-460
-
AuthorPosts
- You must be logged in to reply to this topic.