Jump to content

Help With 'include' statement - Can't Get Mine To Work


Major_Que

Recommended Posts

I am incorporating a very basic 'include' statement on a new site. One 'include' calls up menu.php and the second calls up article.php. Both of these files are located in the same file folder as all the pages for this site.

 

On the index.php page, everything works as expected and both files are showing like they are suppose to. However, the article.php file is not showing up on subsequent pages while the menu.php seems to work fine.

 

Now I am a complete moron when it comes to php so I have no clue what the problem is or how to fix it so I would really appreciate any help I can get to fix this.

 

The site is at http://pickmysmoker.com

 

My code for article 'include' is:

<div id="sidebar" class="link-box">
<h3>Popular Articles</h3>
<?php include("articles.php"); ?>
<br />
</div>
 
 
Thanks in advance . . .
Edited by Major_Que
Link to comment
Share on other sites

I Agree with tryingtolearn. The include statements are working fine as you can see the html output of  articles.php in the (HTML) source code for all your pages (right click > view source).

 

There is most likely an issue with your HTML or CSS for why the the sidebar div does not show on the other pages.

 

 

EDIT. I think I have found the course. In your other pages you have different negative margins applied to the #sidebar selector. Removing the negative margins and the sider appears fine on all the other pages.

 

You may find it easier to use floats instead playing about with margins.

Edited by Ch0cu3r
Link to comment
Share on other sites

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.