Jump to:

23355 Posts in 17873 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Read in blog posts from Wordpress but keep wp-admin

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 752 Views
  • lozhowlett
    Avatar
    Community Member
    144 Posts

    Read in blog posts from Wordpress but keep wp-admin Link to this post

    Hi everyone

    I am building a new site which has an existing wordpress blog. The client wants to keep the admin system for their wordpress blog (there is no movement on thats, its 100% they want it). So I want to build something in SS3 than will read only (i.e. not store in the database) blog posts from their wordpress database and show up in the silverstripe front end (i.e. admin of SS wont see any of the blog posts, they just see a page holder called BlogHolderWP or something).

    Any ideas on how I could go about this, as it means connecting to another database, etc?

    Thanks for any ideas!

  • nmshah
    Avatar
    Community Member
    21 Posts

    Re: Read in blog posts from Wordpress but keep wp-admin Link to this post

    You can use rss from the wordpress blog to be displayed on your silverstripe site

  • lozhowlett
    Avatar
    Community Member
    144 Posts

    Re: Read in blog posts from Wordpress but keep wp-admin Link to this post

    Aer there any examples of this working, including bringing in tags, comments, etc?

  • lozhowlett
    Avatar
    Community Member
    144 Posts

    Re: Read in blog posts from Wordpress but keep wp-admin Link to this post

    For anyone who is also interested I have found the solution!

    1. Create a folder "blog" in the root of you site, put the wordpress files in there
    2. Import the existing WP database and set up, plus manage config variables in the WP database to point to yoursite.com/blog
    3. Update the blog/.htaccess file to...

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>

    # END WordPress

    4. Update the SS3 .htaccess to

    ### SILVERSTRIPE START ###
    <Files *.ss>
       Order deny,allow
       Deny from all
       Allow from 127.0.0.1
    </Files>

    <Files web.config>
       Order deny,allow
       Deny from all
    </Files>

    ErrorDocument 404 /assets/error-404.html
    ErrorDocument 500 /assets/error-500.html

    <IfModule mod_alias.c>
       RedirectMatch 403 /silverstripe-cache(/|$)
    </IfModule>

    <IfModule mod_rewrite.c>
       SetEnv HTTP_MOD_REWRITE On
       RewriteEngine On
       RewriteBase '/'

    RewriteCond %{REQUEST_URI} !^blog/(.*)$
       RewriteCond %{REQUEST_URI} ^(.*)$
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]

    </IfModule>
    ### SILVERSTRIPE END ###

    5. Theme your WP install with the same as your SS site
    6. Use the RSS Reader widget to pull in latest blog posts from your WP blog install

    Happy blog'in!

    752 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.