Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8772803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:07:26+00:00 2026-06-13T18:07:26+00:00

I am building my site base on the product data provided by the vendor.

  • 0

I am building my site base on the product data provided by the vendor. All product related pages are sitting on the vendor’s site.

The vendor allows me to create a “product summary” link to use it as a post in WordPress. Basically the post contains a list of products with brief infomation.

If I click on one of the products, it will take me to the “product detail” page which again it sits on the vendor’s server.

At this point all I can do is show the “product summary” post as a teaser on my front page.

What I really want to use as a teaser on the front page is a few products instead of product summary.

I used file_get_contents() to echo the product detail on my “detail” post:

function demo_file_get_contents(){
    if(is_page('detail')){
       echo file_get_contents('http://vendorsite.com/product.html');
    }
}
add_action('wp_head','demo_file_get_contents');

Then I tried to capture the “green color” attribute, so I can assign this product to a “green” category and show the product as a group of green colored products teasers on the front page.

function demo_retriveAttr(){
  if(is_page('detail')){
     ?>            
        <script type="text/javascript">                
          jQuery(document).ready(function() {   
            $('#color').load('http://mysite.com/detail.html #product-color');            
          });
        </script>
      <?php
  }
}
add_action('wp_footer','demo_retriveAttr');

My questions are:

  1. Is file_get_contents the best practice to capture external data?
  2. the .load() function didn’t work, what did I do wrong?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:07:28+00:00Added an answer on June 13, 2026 at 6:07 pm

    Quick Answers

    1. The file_get_contents is a good one, if your server has access to the website.
    2. If the .load() function didn’t work, you might have to enable CORS. Cross Domain requests are generally blocked by the browser for safety.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a site using symfony php framework. I have a link in my
I'm building a Rails site that, among other things, allows users to build their
I'm building a controller that other controllers can inherit (provide base functionality across site
I'm currently building a site that allows previewing photos and videos using Shadowbox. I'm
I'm building a site layout ( should be cross-browser ie7,8,9 and all the recent
I'm building a mobile oriented web site. New phones most of all use new
When building a static HTML site, you can set the base url like so
building a site using PHP and MySQL that needs to store a lot of
I'm building a site to display my comics- but I've read some tutorials (
I am building a site for experiment and I am having trouble with some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.