![]() |
![]() |
![]() |
||||
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
Industry Role:
Join Date: Sep 2009
Posts: 2,302
|
Quick PHP question
$str .= '<div class="thumb-wrap"><a href="<?php the_field('url'); ?>">';
I know I'm a newb, but this line breaks my code. Is there a way to call a field "URL" (advanced custom fields) within a string of PHP? If I hardcode the URL instead of that line of PHP, I can achieve what I want but I'm pulling it from a post because each url is pulled from a custom field. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Aug 2005
Location: YUROP
Posts: 8,601
|
try
Code:
$str .= '<div class="thumb-wrap"><a href="'.the_field('url').'">';
__________________
![]() Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Just Doing My Own Thing
Industry Role:
Join Date: Jan 2011
Location: London, Spain, New Zealand, GFY - Not Croydon...
Posts: 25,038
|
Yeah - It's a quotes thing I'm sure - Need more coffee...
__________________
- Chaturbate Script - https://gfy.com/fucking-around-and-b...er-issues.html - Now supports White Labels |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Sep 2009
Posts: 2,302
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Sep 2009
Posts: 2,302
|
This is me basically trying to link the featured image. Usually templates allow me to hardcode the featured image but this thing is deeply embedded.
PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Just Doing My Own Thing
Industry Role:
Join Date: Jan 2011
Location: London, Spain, New Zealand, GFY - Not Croydon...
Posts: 25,038
|
url will just give the current page address - Try using myURL or something like that...
__________________
- Chaturbate Script - https://gfy.com/fucking-around-and-b...er-issues.html - Now supports White Labels |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Industry Role:
Join Date: Sep 2009
Posts: 2,302
|
Quote:
To simply my question, I've also added "url" as a custom field in the wordpress post. Any idea how to call on that within my original question? |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Industry Role:
Join Date: Sep 2009
Posts: 2,302
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Just Doing My Own Thing
Industry Role:
Join Date: Jan 2011
Location: London, Spain, New Zealand, GFY - Not Croydon...
Posts: 25,038
|
Quote:
Still only had 2 coffees so could be wrong ![]()
__________________
- Chaturbate Script - https://gfy.com/fucking-around-and-b...er-issues.html - Now supports White Labels |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Industry Role:
Join Date: Sep 2009
Posts: 2,302
|
OK thanks I'll give it a try
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Sep 2009
Posts: 2,302
|
Tried, still giving the same result.
Interesting problem for sure. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Bollocks
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,792
|
Try echoing out the_field('url') to see what it produces. If it echoes out the url you want, the problem is elsewhere.
__________________
Interserver unmanaged AMD Ryzen servers from $73.00 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
It's 42
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
|
$url needs to be the location of a read of the data maybe. Then $data1 becomes the string or array of the data.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Industry Role:
Join Date: Sep 2009
Posts: 2,302
|
Anyone want a few bucks to make this happen for me? I can't get it to work and I really like the theme lol.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
It's 42
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
|
PHP: file_get_contents - Manual
try this file() - Reads entire file into an array fgets() - Gets line from file pointer fread() - Binary-safe file read readfile() - Outputs a file file_put_contents() - Write a string to a file stream_get_contents() - Reads remainder of a stream into a string stream_context_create() - Creates a stream context $http_response_header |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,058
|
Quote:
.
__________________
All cookies cleared! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
So Fucking Banned
Industry Role:
Join Date: Jul 2010
Location: ☣
Posts: 9,327
|
skype me really quick I'll do it
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,058
|
Yeah, like anyone would let you into their server.
Go away scammer. .
__________________
All cookies cleared! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
(>^_^)b
Industry Role:
Join Date: Dec 2011
Posts: 7,223
|
+1 for Sarettah.
If you still need help, email me and I'll figure it out later tonight. ![]()
__________________
![]() I've referred over $1.7mil in spending this past year, you should join in. ![]() ![]() I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years.. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Confirmed User
Industry Role:
Join Date: Sep 2009
Posts: 2,302
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,058
|
Hey,
You r welcome but I should have been able to do that without having you send me the file. lol. I ran into something very similar a while back on something I was working on but forgot about it until I was looking at the file. For the record in case anyone searches on this at some point: The problem was that the wrong function was being used. the_field() echoes the value in the field to the page. get_field() pulls in the value. So the change was changing the_field() to get_field() and it all worked as expected. https://www.advancedcustomfields.com...ces/the_field/ .
__________________
All cookies cleared! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 | |
Industry Role:
Join Date: Mar 2003
Location: San Diego
Posts: 32,180
|
Quote:
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 | |
StraightBro
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,229
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 | |
Making PHP work
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,238
|
Quote:
![]() ![]()
__________________
Make Money with Porn |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 |
Sieg Hi!
Industry Role:
Join Date: May 2011
Location: Lissabon
Posts: 3,614
|
When I read "php" I always get a headache...
Usually 2 weeks later another headache because of the invoice... I'm out...
__________________
Half troll half amazing! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 |
Confirmed User
Industry Role:
Join Date: Sep 2009
Posts: 2,302
|
This is the best part of gfy. I've met some great people here. Keep your head out of the shit threads and you're good. Poo threads by currentlysober are great too!
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 | |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,058
|
Quote:
I bill in advance ;p .
__________________
All cookies cleared! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,058
|
GFY, your source for PHP and POO
![]() .
__________________
All cookies cleared! |
![]() |
![]() ![]() ![]() ![]() ![]() |