Results 1 to 14 of 14

 

Thread: Wordpress and external pages php

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Aug 2008
    Posts
    39
    Thanks
    2
    Thanked 2 Times in 2 Posts


    Hi All,

    This is my first post, and my first attempt at AM (gulp!)

    I would appreciate any help you can give with the little php conundrum below.

    I am using Brian Gardner's Revolution magazine Wordpress theme and I'm using datafeeds with page pagination for my product pages.

    As a result I don't think I can use (or at least can't make it work with ) additional WP pages as they are generated through a php query and so I cannot (as far as I'm aware use 2 queries one after another in a url to navigate to product pages 2, 3 , 4 etc...

    To overcome this I have added an additional folder at the root of my blog for my php product pages named Store.

    My question is: what php code can be used to call the header.php, footer.php and crucially the sidebar.php from the revolution theme home page?

    Currently I've written html versions of those php files and placed them in my store directory as include files in order for them to appear on the product pages, the downside however is that every time I update the sidebar on the home page for example I have to rewrite the html version to include in product pages.

    I hope it all makes sense?

    Any constructive criticism of my site would also be appreciated...

    thanks in advance

    partydressesandmore.co.uk

  2. #2
    Registered User

    Status
    Offline
    Join Date
    May 2008
    Posts
    797
    Thanks
    16
    Thanked 19 Times in 16 Posts
    do you mean

    <?php include 'header.php';?>
    same for footer ???

    just insert that where you want the content of those files to appear
    High Quality Bed Frames From BedFrames.co.uk
    bed frames

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Aug 2008
    Posts
    39
    Thanks
    2
    Thanked 2 Times in 2 Posts
    yes, but as those header, footer and sidebar.php files are in a different directory than the product pages (Store) if I use <?php include ("./sidebar.php"); ?> I get an error message saying the file doesn't exist. i've tried <?php $_Server['DOCUMENT_ROOT']."./sidebar.php";?> and all variation of, but still get the same error message.

  4. #4
    futureweb's Avatar
    Registered User

    Status
    Offline
    Join Date
    Jul 2005
    Location
    North Devon
    Posts
    919
    Thanks
    13
    Thanked 22 Times in 22 Posts
    Your best option would be to write a custom wp plugin to pull the products and paginate them within a wordpress page or - simply download and install the run php or exec php plugin for wordpress and then connect to the the db / datafeed and output your query and pagination within it.

    If you get stuck I could write this for you for £60 - £100

  5. #5
    Registered User

    Status
    Offline
    Join Date
    May 2008
    Posts
    797
    Thanks
    16
    Thanked 19 Times in 16 Posts
    ok if your files ( header etc ) are in a folder called store

    use <?php include ('store/header.php');?>

    id write it for you for free ...

    £60 is ridiculous for 1 line of code futureweb
    High Quality Bed Frames From BedFrames.co.uk
    bed frames

  6. #6
    Registered User

    Status
    Offline
    Join Date
    May 2008
    Posts
    797
    Thanks
    16
    Thanked 19 Times in 16 Posts
    sent you a pm paul
    High Quality Bed Frames From BedFrames.co.uk
    bed frames

  7. #7
    Registered User

    Status
    Offline
    Join Date
    May 2008
    Posts
    797
    Thanks
    16
    Thanked 19 Times in 16 Posts
    try <?php include('http://www.yourdomain.com/STOREDIRECTORY/header.php');?>
    High Quality Bed Frames From BedFrames.co.uk
    bed frames

  8. #8
    futureweb's Avatar
    Registered User

    Status
    Offline
    Join Date
    Jul 2005
    Location
    North Devon
    Posts
    919
    Thanks
    13
    Thanked 22 Times in 22 Posts
    Quote Originally Posted by affiliatemarketingltd View Post
    ok if your files ( header etc ) are in a folder called store

    use <?php include ('store/header.php');?>

    id write it for you for free ...

    £60 is ridiculous for 1 line of code futureweb
    Am I talking about 1 line of code? Nope

    I am saying he would be better off with a custom plugin or using one of the php plugins listed above and including his code within a worpress page - this keeps it all under one roof and makes it easier to manage.

    Please read before you start slagging off numpty.

  9. #9
    Registered User

    Status
    Offline
    Join Date
    May 2008
    Posts
    797
    Thanks
    16
    Thanked 19 Times in 16 Posts
    but its not nessecary ....
    1 line of code will suffice and do what he wants ..
    High Quality Bed Frames From BedFrames.co.uk
    bed frames

  10. #10
    futureweb's Avatar
    Registered User

    Status
    Offline
    Join Date
    Jul 2005
    Location
    North Devon
    Posts
    919
    Thanks
    13
    Thanked 22 Times in 22 Posts
    Well it all depends on how much of your WP functionality you want to keep and how well you wanted to intergrate it with wordpress.

    + you have all kinds of issues with mod_rewrite when making seperate pages outside wordpress when this option is used on both external pages and your blog.

  11. #11
    Registered User

    Status
    Offline
    Join Date
    Aug 2008
    Posts
    39
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Thanks furtureweb, you are an opportunist! don't blame you!

    affiliatemarketingltd; thanks for your reply too! the header.php file resides in the wordpress theme file, and the product pages are in the store directory.

    I was of the same opinion than you initially, as I thought it would be something like your suggestion regarding <?php include 'header.php';?> or a variant thereof, that's why it's so frustrating!

    I'm only basic php, so some of the advanced stuff is still beyond me...

    I do bow to your superior knowledge and would be interested to find out the most efficient way of overcoming the problem in your opinion?

  12. #12
    futureweb's Avatar
    Registered User

    Status
    Offline
    Join Date
    Jul 2005
    Location
    North Devon
    Posts
    919
    Thanks
    13
    Thanked 22 Times in 22 Posts
    M8,

    I gave you your answer, if you can code in php a page to pull and paginate products from a datafeed, you can do it within a wordpress page using the exec php or run php plugin you just type your php as you would in a standalone page.

    I did this without trying to make any money from you and offered it for free.

    I have built wordpress sites for huge affiliates and know my stuff the answers are all there.

  13. #13
    Registered User

    Status
    Offline
    Join Date
    Aug 2008
    Posts
    39
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Thanks Futreweb,

    I wasn't been facetious, I do appreciate you replying to my request

    Took me a while to figure the paginate thing and to be honest untilised the code from phpeasy.com. I'm just new to php

    will have a hunt for the plugins you suggested and see if that will help

    once again thanks

  14. #14
    futureweb's Avatar
    Registered User

    Status
    Offline
    Join Date
    Jul 2005
    Location
    North Devon
    Posts
    919
    Thanks
    13
    Thanked 22 Times in 22 Posts
    No worries m8 - I have spent hours / days / weeks - looking for ways to do what you want and always found it best to keep it within wordpress.

    Just hope it saves you some time.



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2