views:

104

answers:

2

Hello,

i just asked a question few minutes ago which led me to this one :

I want to know if there is any chance to use only the back-end of wordpress ?

I mean,

  • link my admin interface to post news
  • link my visitor interface on my website to the wordpress news so the visitor can access the news

So the visitor never find out that i'm using wordpress to generate the news and handle their comments and write my news ?

Maybe it's possible but there is no point by doing so ?

Thank you

+2  A: 

Sure, it's possible and maybe not even the stupidest thing to do.

If you use image uploads and other things in your posts, people may be able to find out you are using WordPress.

If that doesn't bother you, you can access the contents of a WordPress installed on the same server easily. You will need to include Wordpress's main include in your script. You can then use WP's functions to query and output posts.

The Codex will give you all the functions you need to do this. A starting point is here: get_posts()

A working example from a project of mine showing the latest post headlines:

include("Blog/wp-blog-header.php");

$myposts = get_posts('numberposts=5&offset=0&category=0');

echo "<ul class='Bloglinks'>";

foreach($mypost as $post) 
{
  echo '<li><a href="';
  the_permalink(); // You will want to remove this obviously
  echo '">';
  the_date();
  echo " ";
  the_title();
  echo '</a></li>';
  }

 echo "</ul>";

Caveat: When you include WordPress, it will eat up a lot of your script's memory. Wordpress is pretty fat. You may want to establish some kind of caching mechanism to avoid having to start the WordPress query on every request that is made to your home page.

There are also ways to get hold of a remote WordPress installation's content through RSS (Filters out images, though, I think) and possibly the XML RPC API.

Pekka
A: 

Sure you can - you can do that, only by using custom markup in the frontend. Set your upload-folder to something like "files" and remove the wp_head and wp_footer from your code.

stffn