Have wordpress as a module or extension in Yii - wordpress

I would like to add a blog to a web site. Couldn't find any good blog extension for Yii, so I decided to just use Wordpress. (Please let me know if there's a better way)
I could just extract wordpress in the root folder and run it.
http://www.example.com/wordpress
However, the Yii framework has its index.php on root folder so I will have to make wordpress either a module or extension (I think) unless I put the Yii framework in a root/yiiFolder and use root/wordpress to separate the two. Also, the main layout will have to be different than the Yii default main layout. Otherwise, the blog will share the same header and footer structure of Yii.
Could someone give me an example on how Yii framework call a non-yiiframework site?

If you are having the following error:
include(Translation_Entry.php): failed to open stream: No such file or directory
then you need to disable Autoload, for example like this:
spl_autoload_unregister(array('YiiBase','autoload'));
$wp=dirname(__FILE__).'/../../../../wp-load.php';
require_once($wp);
spl_autoload_register(array('YiiBase','autoload'));

http://wpengineer.com/1038/embed-wordpress-functions-outside-wordpress/ - here is described how to call wordpress functions from outside wordpress. I tried the same thing from Yii layout and now I'm facing strange error. include(Translation_Entry.php): failed to open stream: No such file or directory. I need to look a little more into this.
Other than that - this solution (if you manage to configure it) should give you what you want.

You can include wordpress as a library, and require_once 'wp_config.php' in index.php. Then you can call wordpress function directly.

Related

Symfony 3: Integrate Wordpress for FRONTEND NICE DISPLAY PURPOSE

I am looking for solutions to integrate WordPress to Symfony 3.
My Symfony 3 project is running well with its own custom functionalities but the landing page looks lame compare to a WordPress landing page.
Now I want to update the visual of the landing page. Knowing that is something easy to do with a WordPress template, I am looking for this solution. (I might delegate the building of the WordPress site but need to be sure I can connect it with my existing Symfony 3 project.)
I found plenty of input on the subject, most of them are olds like: this one or that one.
There is also the EkinoWordpressBundle and symfony-wordpress-edition. But those seem to integrate Symfony within WordPress, and as I only require WordPress for display purposes I'd rather have it the other way around.
Any suggested direction to achieve that?
Follow these steps:
Place your wordpress installation into the /web folder e.g /blog
edit your symfony .htaccess file, then comment out this line.
DirectoryIndex app.php
Run your Wordpress as normal i.e wwww.domain.com/blog

how to view and edit a wordpress php file locally (MAMP)

I am helping out creating a few wordpress templates. I've been sent over the basic content (wp-admin/wp-content/wp-includes folders and other wp-* files).
They've already created a new theme, and one front-page.php file. This file includes "parts" such as get_header and get_footer.
Essentially now they'd like me to create new templates using this theme, and php variables to make updating easier. My question is - how can I view this so I can see what i'm making?
I downloaded MAMP and set up a local server, and if I create a sample .php file in the htdocs folder, that page appears correctly. However when I paste the Wordpress folder that I was sent, nothing loads. Is there a special way to get a front-page.php including partials to load within a theme? Am I missing something obvious here?
You will have to Install WordPress completely in order to make it work. Then you will be able to add your folder in the "Themes" folder of WordPress..
You can Google "How to Install WordPress on Mamp" for more info... you will find plenty of websites helping you.
I also suggest you read a few blog post on how to create WordPress Themes... :)
Good luck

Integrate WordPress into existing php site using "the loop"

I'm trying to get WordPress to power a blog on an existing php site. I just want to have a directory www.mysite.com/blog and have wordpress running the pages in that directory, using the same look and feel as the rest of the site.
I'm using the method described in this article :
http://codex.wordpress.org/Integrating_WordPress_with_Your_Website
I already have everything up and running, but I can't find the appropriate php files to edit the css in the wordpress template. I don't know wordpress at all, so I can't trace back to the correct file without knowing the wordpress syntax.
I'm using the WordPress TwentyTwelve them. Can somebody tell me which php and css files control the right hand menu layout?
You can find the relevant files here:
http://yourdomain.com/wp-content/themes/twentytwelve/
The main stylesheet is style.css and the php files are all in there as well to edit to your liking.
NB. if you included the wordpress folder, it will be .../wordpress/wp-content/ etc.

why we are using the ../../../wp-load.php in wordpress?

Sorry for asking this type of stupid ques.
But i don't know I need your help
I look out the coding that they are in wordpress plugin.
require_once('../../../wp-load.php');
I really don't know what the ../../.. is perform some one know ,let me give an suggestion
I am not tell about the core file and all .that extension before the php file.
Thanks.
That loads the WordPress framework for use outside of the native environment.
For example, if you wanted to have a PHP controller that handled AJAX requests, you could load the WordPress environment to validate the current WordPress user login status.
The "../../.." tells the require function to start at the current file, go up three directories, then access wp-load.php.
Based on that path, I can guess that the file is sitting in a theme folder. wp-content/themes/yourtheme

Magento CSS not Loading in New Template

I have posted on the template creator's site, as well as Magento support, but no one has responded.
The CSS is not loading at all on the custom theme I have installed, which is supposedly compatible with the current version of Magento.
You can view the page here: shop.dearearth.net
This is a fresh installation of Magento and the theme, with a fresh database.
I have a feeling it should be a relatively quick fix.
Thanks for looking.
All the links in your page referring to the
http://www.shop.dearearth.net/skin/frontend/base/
directory on your site returns 404. Make sure your css files are in fact in there. Also make sure your links aren't being broken by a .htaccess file.
Make sure your CSS is 777 rights by admin.
OR
Please copy the whole code from latest css and take it as a backup and create a new css file as same name and past the code.
Check in admin back-end, System > Configuration > General/Design if your theme is right specified. Also check if after you installed the new theme, the files have the proper rights (normally, they must be accessible by the web server with Write permissions)
For more info please also take a look at Magento Designers Guide for understanding of how Magento read and split template information. Maybe you have put the CSS and images in a wrong directory :)
Solved.. sort of. The version of the template turned out to be quite outdated, and the incompatible with the current version of Magento, which handles things differently in terms of calling styles in the page.xml file.
Thanks for your inputs.

Resources