Jump to content

Recommended Posts

Hello there,

 

I am trying to recreate a HTML website on a WordPress website. On the current website we pull a php file from the directory that lists brands for different catrogies.

 

http://www.nongmoshoppingguide.com/brands/feed-and-seed.html

 

We use the following script

 

<!--?php <br ?--> <?php include('../lib/IphoneDataRenderer.php');?>
<?php echo $IphoneDataRenderer->getAdsForBrandId();?>

<!--?php } ?-->
<?php $IphoneDataRenderer listBrandsForCategory(); ?>

 

and it works fine for the website above. However, when I add this code within our WP website we don't get any information (I did add the /lib/iphoneDataRenderer.php files and folders).

 

Could you help me understand what I am doing wrong?

 

Many thanks!

 

Link to comment
https://forums.phpfreaks.com/topic/287590-php-include-and-echo-script/
Share on other sites

You can create a new page in wordpress and name a folder the same, drop an index file within that and would work.

 

The preferred way with maintaining your header,navigation and footer is to make a new custom page template in your theme.

http://codex.wordpress.org/Page_Templates

 

 

The basics:

Create a new file in your current themes folder named what would like, lets call it custom.php

 

Add the following code into custom.php

 

<?php
/*
Template Name: Custom
*/
?>

<?php get_header(); ?>

<style>
<!--
  div.custom {
    width: 80%;
    text-decoration: none;
    text-align:center;
    margin-top:0px;
    margin-bottom:0px;
    margin-right: auto;
    margin-left: auto;
    padding:0px;
    }
-->
</style>
 
<?php
echo "<div class='cusrom'>";
 
echo "custom code gets added this area";
 
echo "</div>";
?>
 
<?php get_footer(); ?>

 

In the dashboard create a new page and name whatever you like, select the custom template located lower right area under Template, publish the new page

 

You may also add the sidebar or anything else you desire.

Edited by QuickOldCar
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.