Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » New Versions, & Updating »

Automatically adding text below all images


  #1  
Old Apr 10, 2009, 01:03 PM
myfacegraphics
 
13 posts · Apr 2009
Hi Flynn, seems you are in demand.

I'd like to hire you as soon as possible for a quick mod to my site.
I own www.myfacegraphics.com and have installed your theme.

Basically what I am trying to do is emulate: www.myspacegraphics.co.uk in terms of functionality.
I need to have it so that the "embed code" for each image is displayed beneath each image.

I have been looking at the www.gigya.com widget integration, without success - it's handy because it can post images/content to a variety of social networking websites.

Are you available to help?

Possibly getting the gigya working, or simply getting it so that the embed code is automatically added to each blog post.

I have spent all day todaay working with nextgen image gallery.

Quite like showing things one after the other in a single post, as per here: http://myfacegraphics.com/testing-gallery/ but need to get the code beneath each one (Id like to be able to make sure the right "alt" and description is used for marketing purposes).

As it currently stands if you click an imageit brings up a texarea with the embed code in it, although its been manually added... so yes... what I really need is to be able to add an image to a post, and then use a function which knows the image, knows its location and sets it into an embed code of its own under the image.

Im also going to add adsense under each one too, or at least per page.. might be good for another discussion elsewhere.


so yes Id like to have it for all images on all posts (but a check box to cancel it from time to time would be useful, in case I want to write a regular blog - heck!) )

and if you can have an "alt/description" added so that can be added somehow.
Thanks flynn

shaun

Thanks
Shaun
  #2  
Old Apr 10, 2009, 06:02 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Add this to the bottom of functions.php without causing blank lines or spaces:

PHP Code:
<?php
function bfa_add_code_below_images_callback($matches) {
return 
'<img'.$matches[1].'src="'.$matches[2].'"'.$matches[3].'>
<textarea class="textbox" onclick="this.select(); this.focus();" rows="1" cols="90" 
style="overflow: hidden; height: 30px;" name="myspace-graphics">
<center><a href="http://www.myspacegraphics.com/images/" target="_blank" title="Myspace Graphics">
<img src="'
.$matches[2].'" border="0" alt="Myspace Graphics">
</a><br><b><font face="Arial" size="2"><a href="http://www.myspacegraphics.com/" title="Myspace Graphics">Myspace Graphics</a>
</font></b></center></textarea>'
;
}     
function 
bfa_add_code_below_images($post_body_content) {
$post_body_content preg_replace_callback("|<img(.*?)src=\"(.*?)\"(.*?)>|","bfa_add_code_below_images_callback",$post_body_content);
return 
$post_body_content;
}
add_filter('the_content''bfa_add_code_below_images');
?>
This would add a code area below every image on every page. The images should not be linked and should have no caption.
  #3  
Old Apr 11, 2009, 12:22 AM
myfacegraphics
 
13 posts · Apr 2009
Hiya flynn it generated an error: http://www.myfacegraphics.com/

I got to the file in the wp_includes folder went to the very last ?> then hit the return key to get to the next line and pasted in that code in its entirety

EDIT: I took it out of there and then went and added it to the functions.php inside the atahualpa folder and got a similar error message..

thanks
shaun

Last edited by myfacegraphics; Apr 11, 2009 at 12:24 AM.
  #4  
Old Apr 11, 2009, 04:50 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Sorry I left a piece of code in there, with which I was trying something.

I updated the code above with my working version. Please try again.
  #5  
Old Apr 11, 2009, 05:35 AM
myfacegraphics
 
13 posts · Apr 2009
Thanks.. almost there.. http://myfacegraphics.com/category/myspace-tv-cartoons/

when i try to click to copy the text it brings up the image in a new window when i try to cl;ikck it again it brings me right to the gif file

seems the textarea is clickable unless im doing something wrong?

Thanks again!

shaun
  #6  
Old Apr 11, 2009, 06:28 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
No but I mentioned that the images shouldn't be linked. So you'll have them all linked? Or just a few? What about captions? Linked with captions? Each of these four versions needs a separate piece of code. I'll update this tomorrow, please feel free to remind me if I don't.
  #7  
Old Apr 12, 2009, 12:14 AM
myfacegraphics
 
13 posts · Apr 2009
Hi Flynn... no need I forgot to un-link :-)

After doing this it seems at the moment to work just fine - many thanks!

I'll be sure to come back to you if I need any more revisions done to my site in general (most likely )

Take care, thanks for working on my site.

Much appreciated

Shaun

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
what plugin is better to automatically show thumbnail images in excerpts. falguni1 Plugins & Atahualpa 8 Nov 29, 2009 12:38 PM
Adding php in a text widget? trinity Sidebars & Widgets 2 Jun 15, 2009 08:44 AM
Adding multiple background images? crashley1784 Atahualpa 3 Wordpress theme 0 Jun 6, 2009 07:30 PM
adding text in search widget ppat2 Sidebars & Widgets 1 Apr 28, 2009 12:09 AM
Adding a New Text Style maxhugen Atahualpa 3 Wordpress theme 2 Feb 20, 2009 06:10 PM


All times are GMT -6. The time now is 02:53 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.