I'm attempting to modify a style using blogging platforms. The theme shows a slider around the top of the page, which reads in the featured.php file.
I've gone in to the featured.php and removed all of the PHP code. I'm able to inject my custom HTML in to the featured.php and also the pages display correctly, however want the page to show from the wordpress page.
And so i attempted to:
$html = file_get_contents('http://www.mydomain.com/homepage-featured');
The above mentioned link matches a webpage i produced in wordpress. So i wish to have the ability to inject my HTML into that page after which whenever you load my home page, the PHP informs the browser to show the items in this URL.
The above mentioned code does not work.
file_get_contents() - since it's title indicates - reads personal files in but doesn't print it. You have to
$html variable. An easy method is by using
include() but personally I'd put my custom file on a single server to ensure that way it's not necessary to make use of the file from the remote location thus sparing network traffic.
I believe you've easier to make use of the [cde] function.
include you're using would generate an HTTP request, therefore it will make your script reduced. It could be smart to place the HTML file on a single server if at all possible.
Perhaps you have attempted
If my understanding is correct, you are attempting to utilize a template (featured.php) for any different page apart from the leading page.
To do this, just alter the Page Template from the page(the separate page that is @ www.url.com/myhomepage). You are able to change this @
Alter the template of the page to
Dashboard > Pages (Click Edit link in the required page) > Edit Page > Page Attributes meta box (available in the rightside below Publish) > Template..
(I suppose that the code in file feature.php has
"Featured" at the very top)