Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Integrating Wordpress to Website

Featured Replies

Hi,

 

I'm trying to add a wordpress feed to one of my columns on my website. I would like to be able to for example show the last 5 blog posts on my site to keep the content fresh.

 

I've found loads of tutorials on using include tags for example but can't get any of them working.

 

My beta site is located at - www.tech-ideas.net/test.php.

As you can see as soon as you click it you get my error. I think something must be wrong with the php but I don't know enough to correct it.

 

My blog I want to get the feed from is at www.blog.tech-ideas.net

 

Can anyone see what's wrong with it?

The only thing I can think is the link to the WP header ins't correct.

The source for the site is:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB"> 
<head> 
<title>Tech-Ideas</title> 
<link rel="stylesheet" type="text/css" href="screen.css" media="screen" /> 

</head> 
<body> 
<?php
// Include Wordpress 
define('WP_USE_THEMES', false);
include('./subdomains/blog/httpdocs/wp-blog-header.php');
query_posts('showposts=1');
?>
<div id="header"> 
<center><img src="header.png" width="500" height="100" alt="Header - Page title" /> </center>
</div> 

<div id="nav" align="center">
<ul class="tab"> 
<li class="active"><a href="index.html"><span>Home</span></a></li> 
   <li><a href="about.html"><span>About Us</span></a></li> 
   <li><a href="www.blog.tech-ideas.net"><span>Blog</span></a></li> 
   <li><a href="www.tutorials.tech-ideas.net"><span>Tutorial Articles</span></a></li> 
<li><a href="www.forum.tech-ideas.net"><span>Tech-Ideas Forum</span></a></li> 
 </ul> 
</div>

<div class="colmask threecol"> 
<div class="colmid"> 
	<div class="colleft"> 													
		<div class="col1"> 
			<!-- Column 1 start --> 

			<h1>Welcome</h1> 
			<img src="perfect-3-column-dimensions.gif" width="350" height="370" alt="Three column layout dimensions" /> 
			<p class="dropcaps">Hello and welcome to Tech-Ideas!. </br> Tech-Ideas is a new site available to help you along with PC problems small or large. We provide you with a larger selection of Computing guides and Tutorials that will hopefully help you to both use and troubleshoot your PC. Whats more if things don't go to plan then we are here to provide you with extra help specific to you. Also wht not check out or Tutorial blog where we will post help and tips for some of the newer more common problems as they occur.</p> 

			<h2>How can we help?</h2> 
			<p class="dropcaps">The site is here for you in many different ways</p> 
			<h3>The Forum<h3>
			<p><strong>The Forum</strong> is <strong>THE</strong> place to discuss your problems and get help with specific topics. We can help with a whole range of things both hardware and software related from Windows to Mac via Linux.</p> 
			<p>Furthermore keep an eye out in out Tutorial section. We have gathered our tutorials together to help you find the answers to your problems</p> 
			<dl> 

			<h3>The Blogs<h3>
			<p>To keep the content relevant and organised we have 2 blogs here at Tech-Ideas. The first is out <strong>Users blog</strong>. Here we keep you up to date with some of the leading Technology and computing news. We want to keep you up to date with stories regarding the computing world allowing you to keep up to date with whats going on. </p>
<p>Our second blog the <strong>Tutorials Blog</strong> will be used to post answers to user specified question and to demonstrate fixes for problems that occur. If there is a software glitch that becomes apparent or a new security threat then keep up to date with it in the <strong>Tutorials blog</strong>.</p>
<!-- Column 1 end --> 

		</div> 
		<div class="col2"> 
			<!-- Column 2 start --> 
			<h2>!!!!Col2 Text!!!!</h2> 
			<p>TLorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae purus massa. Cras non tellus neque. Ut mauris felis, dapibus et ornare eu, vulputate nec neque. Curabitur vel massa et tellus convallis mattis sit amet pellentesque enim. Nunc condimentum, urna sit amet sodales lobortis, leo lacus dapibus felis, a auctor sem neque a orci. Vestibulum placerat elementum sagittis. Nunc dapibus varius arcu a fringilla. Morbi tincidunt imperdiet malesuada. Nam turpis ante, ullamcorper sit amet eleifend quis, ultricies mollis mauris. Donec a elit in metus posuere posuere et in purus. Nullam sit amet tortor nec ante facilisis fermentum. Quisque vestibulum tellus at sapien lobortis fermentum. Aliquam feugiat, eros sed gravida tristique, neque libero porta purus, at vestibulum nisl tortor eget purus. Ut a odio metus</p> 
			<h2>More stuff</h2> 
			<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae purus massa. Cras non tellus neque. Ut mauris felis, dapibus et ornare eu, vulputate nec neque. Curabitur vel massa et tellus convallis mattis sit amet pellentesque enim. Nunc condimentum, urna sit amet sodales lobortis, leo lacus dapibus felis, a auctor sem neque a orci. Vestibulum placerat elementum sagittis. Nunc dapibus varius arcu a fringilla. Morbi tincidunt imperdiet malesuada. Nam turpis ante, ullamcorper sit amet eleifend quis, ultricies mollis mauris. Donec a elit in metus posuere posuere et in purus. Nullam sit amet tortor nec ante facilisis fermentum. Quisque vestibulum tellus at sapien lobortis fermentum. Aliquam feugiat, eros sed gravida tristique, neque libero porta purus, at vestibulum nisl tortor eget purus. Ut a odio metus</p> 

			<!-- Column 2 end --> 
		</div> 
		<div class="col3"> 
			<!-- Column 3 start --> 
<?php while (have_posts()): the_post(); ?>
<h2><?php the_title(); ?></h2>
<?php the_excerpt(); ?>
<p><a href="<?php the_permalink(); ?>">Read more...</a></p>
<?php endwhile; ?>

			<!-- Column 3 end --> 
		</div> 
	</div> 
</div> 
</div> 
<div id="footer"> 
<p>footer text</p>	
</div> 

</body> 
</html> 

 

On the actual server the files are in this location:

/subdomains/blog/httpdocs/wp-blog-header.php

 

Do I really need this full link or not?

I'm using > blog/wp-blog-header.php > at the moment but neither works.

 

Any help would be great!

try uploading your page again, at the moment it looks like its trying to load a file from your harddrive

 

No such file or directory in [b]C:\Inetpub\vhosts\tech-ideas.net\httpdocs\test.php[/b]

  • Author

Unfortunatley it doesn't seem to work when I re upload.

 

I change the name and now it load when you put the default url in - www.tech-ideas.net - but it still seems to be pointing there.

 

the only other thought I have is that the server is a virtual server share running Windows, which is the only other reason I could see for it to be pointing to a url like that.

 

Any other ideas?

  • Author

Ah got it working mostly!

 

I used the directory to C: it was pointin to and instead added the rest of the server directory on the end giving:

 

include('C:\Inetpub\vhosts\tech-ideas.net\subdomains\blog\httpdocs\wp-blog-header.php');

 

Now its displaying posts where I need!

 

Thanks for the help.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.