Sign in to follow this  
Followers 0

Using get_the_image() in Pagelines Framework 2.0

14 posts in this topic

Posted · Report post

Hi, I've been trying all afternoon to successfully integrate Get The Image wordpress plugin into my pagelines framework 2.1.6 theme. I've been poking around in class.posts.php, and I haven't quite been able to figure it out. I've tried to set several variables to the return value of get_the_image() so that the results of that function would be sent along to pagelines, but its more complex then I imagined. I was able to do this very easily in platform pro, but obviously pagelines is a more complex system. Could anyone point me in the right direction here? I want my excerpt images/post thumbails to display the results of the get_the_image() plugin function...I just don't know where to plug it in to pagelines theme. I've spent hours on this, and my head is all fuzzy and hurting =( Any suggestions or tips would be greatly appreciated. R

Share this post


Link to post
Share on other sites

Posted · Report post

First, it's really a bad idea to edit core pages as they would be overwritten with the next update and all your work would be lost, not to mention, it's not a supported activity. I don't know that plugin, but per the WordPress page for it, I'm seeing that a php include is suggested. Not sure where you plan to place the images, but, it may be best to try the PHP as a shortcode. You'd do that with Shortcode Exec PHP http://wordpress.org/extend/plugins/shortcode-exec-php/

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks Rangelone, I understand about the update system. I am just trying to figure out WHERE I would do it, before I setup a child template for the fix. Here is the documentation for get-the-image... http://moneyquestions.net/wp-content/plugins/get-the-image/readme.html I checked out the shortcode suggestion...and thats all great, an easy way to execute PHP. But it's not just an arbitrary piece of php I am looking to execute.... the get_the_image() function will return a thumbnail image for me, and I am looking to replace the default featured image in the Postloop, with the image returned by get_the_image()...So I still need to figure out where the featured image thumbnail is set in the postloop.

Share this post


Link to post
Share on other sites

Posted · Report post

Wow. Sounds like a great plugin, but it is going to take lots of customization that I'm sorry to say, goes beyond my skill set. It just ruined my ego. lol. I think this is going to need the help of one of our pros to craft a specialized hook. I'm very familiar with hooks, but this involves the source of the thumbnail. I'm not sure if you'd find it worthwhile but let me suggest getting a quote from http://www.pagelines.com/pros. I'm pretty confident it can be done, I just don't know quite how. Apologies. I'm going to have to go back to the drawing board on this one.

Share this post


Link to post
Share on other sites

Posted · Report post

Oh, one of my colleagues might have a better idea, so don't give up the ship!

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks Rangelone, I won't =)

Share this post


Link to post
Share on other sites

Posted · Report post

Do you need further assistance or will you be contacting a Pro? :)

Share this post


Link to post
Share on other sites

Posted · Report post

I'm bashing my head against it until I can figure it out. Any pointers or thoughts are much appreciated Catrina.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks for the help. I think I've found it. Around line 383 on includes/class.posts.php is this line: [code]$img = ( $mode == 'top' ) ? get_the_post_thumbnail( null, 'large' ) : get_the_post_thumbnail( null, 'thumbnail' );[/code] My get the image plugin is actually not serving up the image correctly, I think it must be the most recent version of wordpress perhaps. So I'm playing with it more, but at least I know where to insert it now =)

Share this post


Link to post
Share on other sites

Posted · Report post

Okay!!! I figured it ALL out. Get The Image works FINE with Pagelines 2.0 and here is how...replace this line, around 383 on includes/class.posts.php [code]$img = ( $mode == 'top' ) ? get_the_post_thumbnail( null, 'large' ) : get_the_post_thumbnail( null, 'thumbnail' );[/code] with this line [code]$img = get_the_image( array( 'echo' => false, 'image_class' => "attachment-thumbnail wp-post-image" ));[/code] That echo parameter being set to false is very important...it sets the function output as a return value instead of an echo, so you can pass the image data back into Pagelines.

Share this post


Link to post
Share on other sites

Posted · Report post

hmmm is there any way to mark this discussion as resolved? I can't accept my own post as an answer...ALSO, for the fix above, you should probably do it under a child theme like rangelone mentioned.

Share this post


Link to post
Share on other sites

Posted · Report post

mmhmm few more nuances here.... around line 270 you will see this: [code]$thumb = ( $this->pagelines_show_thumb( $id ) ) ? $this->post_thumbnail_markup( $excerpt_mode, $format ) : '';[/code] It is the conditional that determines which posts DESERVE to process the thumbnail code. In my case, I changed it to this: [code]$thumb = $this->post_thumbnail_markup( $excerpt_mode, $format );[/code] Which tells ALL posts to process the thumbnail code, regardless of whether or not they have a featured image.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi svakanda, Is this issue now resolved? If so please inform me and I will set the topic to resolved.

Share this post


Link to post
Share on other sites

Posted · Report post

Yeah its resolved...it works fine. Thanks Danny.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0