Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Problems
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 13th, 2012, 06:22 AM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default Shortcodes in product detail not working

Hi guys,

I'm trying to use a plugin called Tubepress but its shortcodes are not working on the product detail page.

I've tried them from posts and they work from there.

I *guess* this is possibly something wrong with the way tubepress has implemented their shortcodes?

Here's an example:

http://www.fitness-saver.com/uk/weider-2990-i-multigym/

And here's a link to my question on tubepress forum:

http://tubepress.org/forum/viewtopic.php?f=19&t=1607

Any help you can provide greatly appreciated.

Kind Regards,
Dave Hilditch
  #2  
Old September 13th, 2012, 07:56 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Try calling the shortcode using PHP like this:

PHP Code:
echo do_shortcode('[short_code_name]'); 
Eric
  #3  
Old September 13th, 2012, 12:01 PM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default

Thanks but no luck:

http://www.fitness-saver.com/uk/spee...pullbuoy-foam/
  #4  
Old September 13th, 2012, 12:30 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

I would write a little function to put in your functions.php file. Call it something like dfr_get_shortcode($title)

Reference that function from your view.

Then in the function have it return the call to do_shortcode() with the title along with it.

Eric
  #5  
Old September 14th, 2012, 05:22 PM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default

That's a good idea - I'll experiment with that tonight.
  #6  
Old October 4th, 2012, 05:02 PM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default

Hi Eric,

Never got round to trying that when I said I would, tried it tonight though and it's still not working.

I've also now tried calling the PHP for tubepress directly:

Quote:
$tubepress_base_url = "http://www.fitness-saver.com/wp-content/plugins/tubepress_pro_2_4_5";
include "/var/www/vhosts/gymeq.com/fitness-saver/wp-content/plugins/tubepress_pro_2_4_5/sys/classes/TubePressPro.class.php";
// include "http://www.fitness-saver.com/wp-content/plugins/tubepress_pro_2_4_5/sys/classes/TubePressPro.class.php";
print TubePressPro::getHtmlForHead(true);
print TubePressPro::getHtmlForShortcode('mode="tag" tagValue="pittsburgh steelers" resultsPerPage="3"');

(as per http://tubepress.org/forum/viewtopic.php?f=19&t=1607 and http://tubepress.org/documentation/u...ress_templates)

Those paths are accurate.

I have tried both relative includes and direct includes but as soon as I add either from within Datafeedr I get a blank page returned.

If instead I add this to header.php, I get an error when trying to call getHtmlForShortcode.

If I could get this part here working, I believe the rest would work:

Quote:
$tubepress_base_url = "http://www.fitness-saver.com/wp-content/plugins/tubepress_pro_2_4_5";
include "/var/www/vhosts/gymeq.com/fitness-saver/wp-content/plugins/tubepress_pro_2_4_5/sys/classes/TubePressPro.class.php";
print TubePressPro::getHtmlForHead(true);
That works perfectly if i run it in header.php and I get the relevant tubepress code added to the <head></head> elements, but when I add it into anywhere in Datafeedr it fails.

For some reason, I believe the scope is different - is this possible?

Last edited by dhilditch : October 4th, 2012 at 05:03 PM.
  #7  
Old October 4th, 2012, 07:49 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

I've tried testing with the free version of TubePress but it does not contain any of the methods that the Pro version refers to.

I also tried adding just this to my header.php file and it does not work:
PHP Code:
<?php echo do_shortcode('[tubepress]'); ?>
That makes me thing that it's not using the built-in WP shortcode engine.

The only thing I can think of is creating a function in your functions.php file, put the code that you have above into that function and call that function from a view in Datafeedr.

In functions.php
PHP Code:
function dfr_get_tb() {
$tubepress_base_url "http://www.fitness-saver.com/wp-content/plugins/tubepress_pro_2_4_5";
include 
"/var/www/vhosts/gymeq.com/fitness-saver/wp-content/plugins/tubepress_pro_2_4_5/sys/classes/TubePressPro.class.php";
print 
TubePressPro::getHtmlForHead(true);

In view:
PHP Code:
echo dfr_get_tb(); 
That's really the only thing I can think of that may work. But I can't test it because I don't have a pro version.

Eric
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Product Detail Page wlk23 Problems 2 August 15th, 2012 04:29 PM
Category Lists thru DFR Shortcodes kaje Questions 2 July 23rd, 2012 12:14 PM
Add comments box to Product Detail crazysaver Questions 11 July 4th, 2012 06:19 AM
Is there any way to display product ratings (*****) in Categories and Product detail? sandeep821 Questions 3 April 25th, 2012 10:25 AM
Can I use shortcodes in a text widget? DogWalkingGear Questions 3 September 16th, 2011 08:05 AM


All times are GMT -5. The time now is 11:44 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.