![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Apr 2002
Location: State Of Bliss
Posts: 2,438
|
Wordpress: unexpected T_STRING error
I have a custom field named galleries that is producing the "Parse error: syntax error, unexpected T_STRING" error.
galleries field has the server location of a gallery ( /home/www/gallery1.php ) If I hardcode the link in the template it works Code:
<?php include('/home/www/gallery1.php'); ?> Code:
<?php include('<?php echo get_post_meta($post->ID, 'galleries', true) ?>'); ?> Whats wrong with this line? ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: May 2012
Posts: 124
|
Code:
<?php include('<?php echo get_post_meta($post->ID, 'galleries', true) ?>'); ?> The immediate reason you get T_STRING error is because you have single quotes within single quotes. Also the use of include is incorrect and unnecessary.. Just do <?php echo get_post_meta($post->ID, 'galleries', true); ?> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Join Date: Apr 2002
Location: State Of Bliss
Posts: 2,438
|
Quote:
If I use just the <?php echo get_post_meta($post->ID, 'galleries', true); ?> it just prints out the location of the gallery /home/www/gallery1.php What I'm trying to do is include a html page within the template. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Apr 2002
Location: State Of Bliss
Posts: 2,438
|
If figured it out.
I set the custom field as a variable, then used that var in the include. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Feb 2011
Location: Ontario, Canada
Posts: 1,026
|
<?php include(get_post_meta($post->ID, 'galleries', true)); ?>
Thats probably what you wanted if the path is correct.
__________________
[email protected] ICQ: 269486444 ZoxEmbedTube - Build unlimited "fake" tubes with this easy 100% unencoded CMS! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Apr 2002
Location: State Of Bliss
Posts: 2,438
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Industry Role:
Join Date: May 2012
Posts: 124
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Damn Right I Kiss Ass!
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,391
|
this thread delivers
|
![]() |
![]() ![]() ![]() ![]() ![]() |