« first day (3672 days earlier)      last day (1571 days later) » 

16:40
Hi, is there anyone around. I got a question reference the wordpress uploads folder :)
Hello! People tend to come and go throughout the day so you may need to check back later. Feel free to ask your question though!
Hey thats fine :) basically Im using

`file_get_contents()`

on the WP directory to retrieve information on an image, however it is returning false, yet the image exists and i am stumped
16:54
Are you passing the full path to file_get_contents()?
If you have the file ID you can call get_attached_file() to get the path. Otherwise if you have the URL or filename you might be able to grab the ID by searching the posts table guid field.
or are you passing a URL to file_get_contents? What are you trying to do that needs this 🤔
17:20
Hi both, so basically I am writing an uploaded image into the media folder, but need to read the contents of the uploaded file. Im passing the url into it, the url exists, but its returning false. I dont have the ID of the file @Howdy_McGee
Sorry for the delay :)
@KirstyMarks are you creating an attachment, or are you literally creating a folder and dumping files in there with PHP file functions?
You also might try this to get the attachment ID via attachment_url_to_postid(). Once your have the actual attachment ID you can pretty much do whatever you want with it.
if so this is probably better asked on the main site, it's a bit too involved for chat and would need code sharing
Hey thats fine, I will do it on the main site :) ty both
just remember, if you want to use any of the WP image APIs you're going to need an attachment post. If you're just handling an upload by writing the file to a folder in wp-content/uploads then none of that is available to you
 
2 hours later…
19:39
Hey guys, is there a hook to change the word "by" before the post meta author name? Idk why I can't find it. Just want to remove it all together, instead of "By Timothy Fisher" just "Timothy Fisher".
20:06
@TimothyFisher This is likely a baked in theme feature. Presuming it uses the_author() function, the only hook is the_author filter but there's no "by" given.
I imagine you'll have to open the theme in a preferred editor an grep the files for it.
20:57
@Howdy_McGee Yeah you're right. I was using the Divi Builder and their blog module doesn't have a hook to customize it so I had to hook in and str_replace it because it wasn't wrapped in any sort of tag. Thank you!

« first day (3672 days earlier)      last day (1571 days later) »