Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
$20
How to include custom field data in Prettyphoto?
However, when I use PHP from the example (it is true or false):
if(get_field('has_the_portrait_sold')){
echo "The item has been sold.";
}else{
echo "The item has not been sold";
}In header.php:
<script type text/javascript>
jQuery(document).ready(function($) {
$("a[href$='.jpg'], a[href$='.jpeg'],
a[href$='.gif'], a[href$='.png']").prettyPhoto({
theme: 'dark_square',
show_title: true, /* true/false */
social_tools: '<?php the_title(); ?> <?php
if(get_field('has_the_portrait_sold')){
echo "do something";
}else{
echo "do something else";
}
?>'
});
});
</script>However, while this may include the custom field in the lightbox as needed, it apparently only displays custom field data for the current page. I am needing custom field data to print for the current lightbox item / WordPress' image attachment.
I therefore tried including the custom field call in post-template.php. I've been told this is not recommended.
However, while this may include the custom field in the lightbox as needed, it apparently only displays custom field data for the current page. I am needing custom field data to print for the current lightbox item / WordPress' image attachment.
I therefore tried including the custom field call in post-template.php. Please note my PHP skills are limited, I am VERY determined to make this work.
return apply_filters( 'wp_get_attachment_link', "<a title='$post_title'
href='$url'>$link_text</a><?php
if(get_field('has_the_portrait_sold')){
echo "do something";
}else{
echo "do something else";
}
?>", $id, $size, $permalink, $icon, $text );
}I was given a brief explanation at StackExchange, however, I just need someone to spell it out for me. Tell me what I need to do to get my custom field to show up in my lightbox. I'm desperate. Thanks.
AndrewJohn | 06/20/12 at 12:13am
Edit
(2) Possible Answers Submitted...
Note: AndrewJohn felt their question was unanswered, so we granted them a refund.
Note: AndrewJohn requested a refund. They offered this explanation:
"Passed deadline and no one could provide a straightforward solution."If no one challenges a refund request, then they are automatically granted and proccessed after 48 hours. Admins of this site only review refund requests if someone challenges the request. If you are curious about how we handled previous refund requests, you may read over all refund requests and their challenges.
See a chronological view of answers?
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
-

Last edited:
06/20/12
12:36amRomel Apuya says:I think the onw you need to edit is the prettyphoto.php
im not just sure how does the code look like or is integretad in the theme
but if you give me access i can probably help and explain to you,
cheers,- 06/20/12 1:28am
AndrewJohn says:PrettyPhoto is not PHP based. It is based on Jquery. Take a look at the documentation here and send your recommendation: http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/documentation/
- 06/20/12 1:39am
Romel Apuya says:of course their are other prettyphoto that is PHP based.
can you share your original functions.php code?
- 06/20/12 1:41am
AndrewJohn says:My theme's functions.php is at http://pastebin.com/bWsGykFi
- 06/20/12 1:50am
Romel Apuya says:just use single qoute in the echo of do something
return apply_filters( 'wp_get_attachment_link', "<a title='$post_title' href='$url'>$link_text</a>
if(get_field('has_the_portrait_sold')){
echo 'do something';
}else{
echo 'do something else';
}
?>", $id, $size, $permalink, $icon, $text );
} - 06/20/12 1:58am
AndrewJohn says:I copied your code exactly and included it at the end of functions.php and I received this error:
Parse error: syntax error, unexpected '}' in /home/andrewsa/public_html/ra/newmasters/wp-content/themes/v1/functions.php on line 874 - 06/20/12 2:08am
Romel Apuya says:remove the extra } of your function.php line 890 on the pastebin code.
- 06/20/12 2:11am
Romel Apuya says:http://pastebin.com/eCWUEUvP
- 06/20/12 2:25am
AndrewJohn says:'Do something else' prints above my gallery. How do I get this to show up on my lightbox?
Plus now I'm getting this error in post.php in wp-admin:
Warning: Cannot modify header information - headers already sent by (output started at /home/andrewsa/public_html/ra/newmasters/wp-content/themes/v1/functions.php:1) in /home/andrewsa/public_html/ra/newmasters/wp-includes/pluggable.php on line 866 - 06/20/12 2:33am
AndrewJohn says:*corrected link: http://tinyurl.com/7mqpt6r
- 06/20/12 1:28am
-

Last edited:
06/20/12
1:18amArnav Joy says:you have to use your this code
return apply_filters( 'wp_get_attachment_link', "<a title='$post_title'
href='$url'>$link_text</a><?php
if(get_field('has_the_portrait_sold')){
echo "do something";
}else{
echo "do something else";
}
?>", $id, $size, $permalink, $icon, $text );
}
in functions.php and not in post-template.phpPrevious versions of this answer: 06/20/12 at 1:18am
- 06/20/12 1:30am
AndrewJohn says:Am I including this code in my theme's functions.php or WordPress' functions.php? I tried inserting it into my theme's functions.php and I received this error:
Parse error: syntax error, unexpected T_DO in /home/andrewsa/public_html/ra/newmasters/wp-content/themes/v1/functions.php on line 870 - 06/20/12 1:34am
Arnav Joy says:share your original theme's functions.php here
- 06/20/12 1:38am
AndrewJohn says:http://pastebin.com/bWsGykFi
- 06/20/12 1:53am
Arnav Joy says:here is the new full code of functions.php
http://pastebin.com/wAPSYT02 - 06/20/12 2:04am
AndrewJohn says:I copied the entire file and replaced my theme's functions.php and I received this error:
Parse error: syntax error, unexpected '}' in /home/andrewsa/public_html/ra/newmasters/wp-content/themes/v1/functions.php on line 862 - 06/20/12 2:06am
Arnav Joy says:give me original functions.php
not that one which you given last time after adding your code , i need to see original functions.php - 06/20/12 2:28am
AndrewJohn says:Here is functions.php without code: http://pastebin.com/tdNAqxJw
- 06/20/12 2:43am
Arnav Joy says:try this
http://pastebin.com/LkC8W0YE - 06/20/12 2:51am
AndrewJohn says:'do something' shows up above my gallery now. how do i get this to show in my lightbox? http://tinyurl.com/7mqpt6r
- 06/20/12 3:57am
Arnav Joy says:where you want to show it in caption?
- 06/20/12 4:02am
AndrewJohn says:Anywhere in the lightbox is fine. I can always style it later with CSS
- 06/20/12 1:30am
This question has expired.
Current status of this question: Refunded
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
