May 11, 2014 at 6:37 pm #104568
I've been a web developer for a long time but always custom coded everything. This is my first attempt at wordpress and I just bought the beautiful theme.
What is the best practice for handling custom scripting (php) on a single page? For example... where do i place scripts? Do I need to make a page template? If so how? When I look at the existing templates all I see is:
I'm trying to create a page like : http://mygroovysite/video/xyz123abc
What I'm trying to make happen is the page template "video" is loaded and then a youtube video with id "xyz123abc" plays.
I've done this numerous times before on my own custom sites so scripting is not the problem, it's understanding the best practices in the world of wordpress that I need help with.
I know somebody is going to post a link to some youtube plugin but to be honest I'm yet to see a plugin do precisely what I'd like it to.May 11, 2014 at 6:58 pm #104573May 11, 2014 at 7:41 pm #104580
add this to my child theme? I'm using "beautiful".
will this break updates?
1. when i open page.php template all i see is: genesis(); not sure how to add php here? wouldn't the scripts results get added after or before the page and not inside the page?
2. can you provide an example please? not sure what "the function" means.
(I'm brand new to wp )
ThanksMay 11, 2014 at 8:55 pm #104595May 11, 2014 at 8:55 pm #104596May 12, 2014 at 8:02 am #104646
I'm afraid it's a local instance. I'm just getting the feel for wordpress and genesis locally before I dare port it live.May 12, 2014 at 10:47 pm #104852
@bionary, what is the behavior that you want, exactly?
In WordPress, you can just put the URL to a YouTube video directly in a post or page (using the text editor) and it'll load the player right there, with no iframe or special coding required. It won't start playing the video automatically when the page is loaded though. Is that what you are trying to do?May 12, 2014 at 10:52 pm #104853
Also to answer your original question: You can insert custom PHP code in any template file - before the genesis() function - here's a simple tutorial that shows how (which happens to load some videos too):May 17, 2014 at 5:44 pm #105667
ah, ok thanks.
You must be logged in to reply to this topic.