why we are using the ../../../wp-load.php in wordpress? - 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

Related

I can not access my WordPress dashboard because of a plugin called "Clef"

I have activated a Two Factor Authentication sing in method called "Clef" on my WordPress based site. It turns out they have shut "Clef" down on July 2017.
The problem is that when I want to sign in to my WordPress dashboard, I get a "loading clef login" page and nothing happens.
How can I remove it?
As promised, here are the steps you could take:
Option A:
Download FileZilla
Log in, using the Login Credentials supplied by your Registrar/Hosting Provide
Go to: /httpdocs/wp-content/plugins
If /httpsdocs/ is not there, simply head to /wp-content/plugins
Find the name of your Plugin (Presumably 'Clef') and simply delete the Folder.
Option B:
I am not sure who is providing your Domain/Hosting but you can always login via your Domain/Hosting Control Panel and delete the Folder from the Web files, that way.
If I were you, stick to Option A. Not only is it the most universal but something I would advise getting an understanding for, since you could use FileZilla to backup your Web Files in the future.
Any problems, drop me a Comment and I will help you along the way, if needs.
The easiest (and possibly the only) way will be going to the FTP server, going to wp-content/plugins/ directory and removing clef directory (or whatever is the name of this plugins directory name).
WordPress will disable this plugin automatically, if it doesn't exist anymore.

drupal_get_private_key equivalent Wordpress

I'm trying to convert the theme from Drupal to Wordpress, I don't know a lot about drupal, so this function "drupal_get_private_key" confuses me a little and I can't really find a lot of documentation about it. Could someone explain me what is this function about and how could I do this in Wordpress?
Thank you for the help
Drupal uses this to generate the paths to files* (its used in other stuff too, but in themming I believe its the main reason).
*These files are the files created by users, not the files in the theme folder. The folders are configured in the admin and, when an user uploads a news picture, for example, it will be placed in the configured folder.
You problably just want to find another way to find these paths.

wordpress theme doesn't appear

I'm having a very basic problem: I'm trying to create a new theme for a wordpress installation locally on my computer.
I've created a styles.css and index.php file and put it in a folder in wp-content/themes. But it doesn't appear in the Wordpress themes page.
As a test, I made a change to the description of one of the existing themes (Twenty-Ten) in its style.css, and refresh the Wordpress themes page, but the old description continues to be shown. This suggests to me that I'm simply using the wrong folder, but that's not possible! Any ideas on this problem much appreciated.
UPDATE: In fact, even when I delete Twenty Ten from the Themes folder, it's still available as an option in the Wordpress backend, and I can activate it... Very strange...
G
I agree with your diagnosis. You are either looking at the wrong folder or in fact the wrong computer. There's no other way that you could change the theme to one that has been deleted.
I suggest that you confirm you are in the same universe you think you are in. Create a simple file localserver.txt in your WordPress directory and then confirm that you can access that file.
If you can't, you have your answer. You are somehow accessing a different location.
If you can access that text file, you need to go further and look to see if something like the site url setting is redirecting you to the live site, without you realizing it, when you access wp-admin.
Beyond that, I'd need to know more about your setup. Something like having www.example.com in your /etc/host file and not example.com can cause similar confusion...
Are you using Wordpress Multisite?
In that case you have to 'enable' that theme in the Network admin manager

Using Wordpress in CakePHP for views

I'm using the latest version of Wordpress for the public portion of my site and CakePHP for the actual web application. Since I want to keep the application consistent, I want to use Wordpress functions (for example get_header(), get_sidebar(), and get_footer()) to achieve this in my view files. Can I just use an require statement and call in the functions I need? Has anyone done this? Would there be any conflicts (e.g. functions with the same name) and is there a way to avoid it?
Additionally, I know CakePHP usually assumes path are relative to the app/ directory. Is there a way to get around this?
I recently tried something similar. You would be combining both codebases, and yes, there are name collisions. PHP5 namespaces would fix this, but they are only planned for CakePHP 3.0.
I'm not sure about including certain parts of WordPress into a CakePHP app, it would probably get quite messy and WP might fail if its being loaded in a different path to what it expects. Unless someone else has done it before you might find yourself doing a lot of work and discovering that it can't be done at all.
There are some guides to installing them side-by-side, but nothing seems to cover grabbing posts, and parts of the template from WP in Cake.
Here are the some options I would think about:
1) Having WP located in /blog and simply make sure your WP theme matches your CakePHP layout visually.
2) Build a simple blogging platform into your Cake application.
3) Build the CakePHP part of your application as a WordPress plugin.

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.

Resources