Integrate WordPress into existing php site using "the loop" - wordpress

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.

Related

Wordpress website hacked and .htaccess file is creating automatically with strange code

In my wordpress website .htaccess has some strange redirection script, i removed the file but once the site is browsed the .htaccess file is automatically created with the strange script. in addition to that a folder named generall is also automatically creating even though we delete the folder. The folder has one php file and html file with strange scripts. Please help to resolve the hacking issue
You need to completely remove the infection from your site. Here's the easiest WordPress guide to follow: https://malcure.com/blog/security/the-easiest-guide-to-wordpress-malware-removal/
Your website still contains malware. You need to do a complete virus scan. You can use WordFence plugin to scan.
With these also try
1. Update all theme & plugins.
2. Do a manual update of your WordPress.

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

Putting a custom directory inside wordpress

I have a simple HTML microsite, which I want to put inside my wordpress website. For example: Wordpress website is: abc.com
I want to put my microsite inside this wordpress site. So URL becomes:
abc.com/microsite/
But, wordpress treats any url as its own. How can put "abc.com/microsite/" urls to Wordpress Ignore list. So that any pages inside microsite folder executes independently.
just put you folder 'microsite' in root(Where you find wp-admin,wp-content and wp-include folder). and
you are able to access the folder
"abc.com/microsite/ by this url
If you are still having issues with accessing the subfolder, try renaming the .htaccess to .htaccess-bak in order for WordPress to regenerate the file again. Understand that your website might temporarily go down.
I've found this solution to help in some cases, but I don't know exactly why, ergo I am not sure it will work. And if you feel uncomfortable editing the .htaccess file I suggest you learn more about it (as should I). It is a very powerful file and WordPress uses it a good deal.
P.S. The file is located in the same folder, WordPress' root folder where you find /wp-admin/, /wp-content/, etc. It is hidden by some hosting providers, but I've always been able to find them through FTP with the hosting companies I've used before.

Have wordpress as a module or extension in Yii

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.

Find the source files of Wordpress

i mean i want to see the source file of the main page.
when i click right click and choice the option view source, so i want to find
the "body" of the file,and edit it physical, which folder can i find it ?
thanks friends.
WordPress's HTML is generated by PHP in conjunction with CSS, so look in your active theme folder in wp-content/themes/yourtheme. You'll find all the parts of a WordPress theme: Using Themes « WordPress Codex.
WordPress runs on the server -- the "source" you're viewing from your browser is client-side, and is essentially the output of the WordPress PHP code that generates the pages (and some CSS transforms). In order to see the PHP source, you'll have to download it from WordPress's website yourself or look at your WP installation directory on your server.

Resources