Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

Post Title As Search Term In Wordpress Templates


  • Please log in to reply
7 replies to this topic

#1 Jason Shpik

Jason Shpik

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 13 December 2010 - 12:38 AM

Hello,

Is it possible to do this? Based on the documentation it has this:

<?php
  
    include "/var/www/html/myblog.com/wp-content/plugins/tubepress_pro_2_1_2/env/pro/tubepress-pro.php";
  
    get_header();
  
    print tubepressGallery('mode="tag" tagValue="pittsburgh steelers" resultsPerPage="3"');
     
    if (have_posts()) :
       while (have_posts()) :
          the_post();
          the_content();
       endwhile;
    endif;
    get_sidebar();
    get_footer(); 
?>

To insert into a Wordpress template. However I'd like to base the search term on the post title because I have hundreds of thousands of posts. I have this in the template that I think I might use it somehow, it would be placed in single.php.

<?php the_title(); ?>

I'd like to know if this is possible before I decide to purchase pro. Thanks.

#2 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 13 December 2010 - 01:04 AM

Hi,

You've got all the pieces, and they're easy to put together. You'll want to do something like this:

<?php      include "/var/www/html/myblog.com/wp-content/plugins/tubepress_pro_2_1_2/env/pro/tubepress-pro.php";      get_header();      print tubepressGallery('mode="tag" tagValue="' . the_title() . '" resultsPerPage="3"');         if (have_posts()) :       while (have_posts()) :          the_post();          the_content();       endwhile;    endif;    get_sidebar();    get_footer(); ?>
So to answer your question, yes, this is possible and easy to do with TubePress Pro. Let me know how else I can help. Thanks!

#3 Jason Shpik

Jason Shpik

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 13 December 2010 - 10:10 PM

OK I bought pro and here's what I put into single.php :

<?php include "path to tubepress pro"; ?>
<?php print tubepressGallery('mode="tag" tagValue="' . the_title() . '" resultsPerPage="3"'); ?>

Only problem is it's printing the title of the post on the page, and listing a bunch of youtube videos that have nothing to do with those search results.

#4 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 13 December 2010 - 10:36 PM

Do you have a link to your site that you could share? It's difficult to say what exactly needs to be adjusted without seeing the gallery's debug output. You can PM me if you don't want to share your site with the world..

#5 < no first name > Graner

< no first name > Graner

    Member

  • Members
  • PipPip
  • 12 posts

Posted 25 December 2011 - 11:09 PM

1. was this ever fixed? i'm having the same issue as i'm trying to dymanically add a video gallery based on the title of my posts and it's coming up with very wierd videos that don't match.

when i manually update the tagValue="rocks", it works fine

2. the other thing i'm trying to do is add the video gallery from within the loop, is that possible? currently i'm just getting a blank area

#6 < no first name > Graner

< no first name > Graner

    Member

  • Members
  • PipPip
  • 12 posts

Posted 25 December 2011 - 11:26 PM

here's my code below

<?php if($theme_review_links == "0") { ?>

	<?php require_once('review-tabs.php'); ?>

<?php } else { ?>

	<?php the_content(); ?>

	<?php print TubePressPro::getHtmlForShortcode('mode="tag" tagValue="' . the_title() . '" orderBy="relevance"'); ?>

	<?php wp_link_pages('before=<div class="clear"></div><div class="wp-pagenavi post-navi">&pagelink=<span>%</span>&after=</div>'); ?>

	<?php if($theme_related_reviews == "0") { require('related-items.php'); } ?>

	<?php comments_template(); ?>

<?php } ?>

I'm trying to post the video gallery after my post content (inside the loop) and before the comments but nothing shows up but when I put the line for the video galleries after the bottom of this code, the gallery work (outside of the loop possibly?)

#7 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 01 January 2012 - 10:23 PM

I'm trying to post the video gallery after my post content (inside the loop) and before the comments but nothing shows up but when I put the line for the video galleries after the bottom of this code, the gallery work (outside of the loop possibly?)


Just responded to your other thread, but this syntax looks correct to me. Would you be able to post the entire content of your template file? Also, don't forget to include TubePressPro.class.php somewhere in your file as described in the docs. We'll get it figured out!

#8 Sahil Hussain

Sahil Hussain

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 10 February 2012 - 09:13 PM

Hi Eric , did you find out how to get this working ?

I have included the tubepress class right before my header and here's the code that i am using -

<?php 
print TubePressPro::getHtmlForShortcode('mode="tag" tagValue=\"'. the_title .'\" resultsPerPage="1" embeddedWidth="520" embeddedHeight="324" autoplay="false" length="false" showRelated="false" showInfo="true" views="false"');  ?>