The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
31 views

How to avoid wp-load.php within a PHP/CSS file?

This is tricky, as people usually mix wp-load with AJAX and I can't really find a proper answer. Case 1 I have a dynamic style.php file that looks like this: <?php header("Content-type: ...
0
votes
0answers
18 views

Get wp-load.php PATH with wp_localize_script and JavaScript for plugin

I just learned about wp_localize_script() and it's very cool. I read Otto's post and Gary Cao's post, but I'm learning Ajax so I'm trying to wrap my head around getting the path to wp-load.php this ...
1
vote
2answers
77 views

Load wordpress content in other domain

I've made some researches on google but can't get the right answer. I need to get my wordpress loops outside a domain using php file. For example: I have a website hosted with www.mysite.com using ...
0
votes
1answer
27 views

Is it possible to get post metadata of referring page?

I'm trying to direct a php authorization script to act if the page that referred to it belongs to a certain category (free). Is there something other than <?php wp_get_referer() ?> that will ...
0
votes
0answers
36 views

Using htaccess and php to protect file, MIME problem

I'm using the method described here: Protecting WordPress Media Uploads Unless User Is Logged In (Based off of How to Protect Uploads, if User is not Logged In?. The redirect is working perfectly, ...
-3
votes
1answer
30 views

content of the page is not displaying getting empty page [closed]

<body> <div id="wrapper"> <h2>1stWebDesigner PHP Template</h2> <ul> <?php wp_list_pages('title_li=');?> </ul> </div> <!-- end #nav --> ...
0
votes
0answers
55 views

Why I have this error when I try to install this old blog on my local webserver?

I am pretty new to WP (I came from Joomla) and I am finding some difficulties trying to put on my local web server an old backup of a website (made using WP 3.5) I have performed the following ...
0
votes
0answers
55 views

Including wp-load.php redirects the whole site to wp-admin/install.php

I want to give access of pages for a site that is not actually in wordpress. Client already have the wordpress website. I know that if i include the wp-load.php file outside from wordpress then i can ...
-1
votes
2answers
31 views

Sessions in word press [duplicate]

Is it possible to set session in wordpress. If yes can you please tell how to do it? My sample code is. <?php session_start(); if(!isset($_SESSION['impression'])) { $_SESSION['impression'] = ...
0
votes
3answers
146 views

How to load wordpress environment without loading the template?

Basically I want to use wordpress functions for example wp_create_user() or wp_update_user() outside of wordpress (outside of wordpress directory). I tried with all the below code snippets to load ...
0
votes
1answer
106 views

Trying to avoid including wp-load.php

I am working a plugin where I am trying to connect an HR system with WordPress. There is an XML API on the HR system so I have written the plugin to take the data and put it into a WordPress database ...
0
votes
1answer
69 views

How to efficiently load and use the wordpress API from outside the original structure

I want to call Wordpress functions (the same ones we use to build a theme) from outside the original structure / folder / files of Wordpress. For example, in my theme folder I created a folder ...
1
vote
1answer
38 views

Include user defined styles without including wp-load

I've looked through the answers on here and none quite match my situation. I have custom CSS that a user can edit and it is saved in the options. I use wp_enqueue_style to include a PHP file with a ...
0
votes
0answers
34 views

get_post_meta() not loaded with wp-load

I am executing this code in my external php file (= I am accessing his externaly without loading the full WP; I have a reason why I am doing it) that is located here: ...
1
vote
3answers
235 views

update_option not working in stand-alone PHP script

I have a standalone PHP script in my WordPress theme's directory that I run once every hour through a cron job (or manually if needed). All other WordPress functions are working except the ...
0
votes
0answers
11 views

Include wp-load.php in custom PHP script [duplicate]

I am building a Wordpress website where I need a custom registration page with extra fields which sends extra fields in a email. My idea was to create the custom form then in the posted script use ...
0
votes
1answer
162 views

Frontend file upload works, but I get error “Constant ABSPATH already defined”

I am uploading files from the frontend. It works perfectly, yet I am getting the error: Constant ABSPATH already defined This is at the top of my file upload script: require ...
0
votes
1answer
57 views

WordPress and IPN problem

I have created a file in my template folder called ipn.php: <?php $req = 'cmd=_notify-validate'; foreach($_POST as $key => $value) : $value = urlencode(stripslashes($value)); $req .= ...
0
votes
0answers
95 views

To call hook on a php external file

I can't to call the a filter hook on a php external file of wordpress. This is my code - my_external_file.php -: <?php require( dirname(__FILE__) . '/../../../../../../../wp-load.php'); ...
0
votes
2answers
303 views

PHP mobile redirect Endless loop

I have a mobile version I'm building outside of Wordpress in a subfolder on the same server as my Wordpress install. I'm including the wp-load.php file to pull content from the WordPress database. If ...
1
vote
1answer
70 views

Use wordpress functions in another PHP file

I have created in my theme folder a PHP file named gallery.php. In this file I want to use WP_Query function, but I can't do this because it shows error. Is possible to do this? Thanks in advance!
0
votes
0answers
98 views

Load loop in external php file, ajax loading posts

Why does my loop always return "no posts" ? I've included all necessary files it seems. I'd like to use this page for ajax calls, but I cannot get it to work as a normal loop. If I use get_posts it ...
0
votes
0answers
35 views

Go-Script get_option without theme

i use a go-script into my plugin for redirecting users and needs into this script access to the plugin options. The Script looks like this: <?php define('DOING_AJAX', true); ...
0
votes
2answers
223 views

wordpress login blank screen [closed]

i wanted to make an offline copy of my live website on my pc so i installed xamp and installed on it wordpress and exported the database and took a copy of files on fttp and after i have done ...
0
votes
1answer
105 views

wp-load.php redeclares classes

I am trying to load WordPress options within a standalone PHP file. The file is located in /wp-content/plugins/plugin-name/file.php. I have used the following to open wp-load.php: if ...
0
votes
1answer
62 views

Get Core Functionality from Within a (Secondary) Plugin File

I have a plugin with the following structure: myplugin.php includes/authentication.php I can access core WordPress functionality inside myplugin.php fine, but when I try to access stuff such as ...
0
votes
1answer
107 views

Wordpress repository forbids me call wp-load.php in non-WordPress file

I have made a Wordpress Plugin that is a kind of Download Manager. I have a external file download.php that is responsible for making downloads. This file is away of environment Wordpress, for this ...
5
votes
2answers
1k views

Initialize WordPress environment to use in command line script

I have a command line script for maintaining a wordpress plugin and have to load the wordpress core to be able to access wordpress functions. This problem is very similar to Initialize WordPress ...
0
votes
3answers
748 views

How to load WordPress on non WP page?

I want to use the get_option() function of wordpress in one of my theme's files, which is not related to WP, it is just located in the same directory of the other theme files. I need this file because ...
-2
votes
1answer
581 views

Use ajax response in PHP function

Ok, so I'm working on a plugin and just ran into a problem. Here's what I'm doing: 1. Using a metabox with Plupload to upload an image to an upload dir in the plugin folder. 2. Upon upload success a ...
3
votes
3answers
869 views

Creating a Dynamic Path to wp-blog-header.php

Created a class in an external script which is dependent on the Wordpress environment. Since it's a class I intend to use on various projects, I decided to dynamically create a path to ...
0
votes
2answers
475 views

Including 'wp-load.php' after another include() generates an error

I know all the downsides of trying to include wp-load.php, but bear with me :) I'm trying to create my own admin-ajax-like functionality, in a way that I can control whether or not I load the default ...
0
votes
1answer
147 views

What is Global Wordpress Objects?

I was trying to load wordpress in a smarty template and i have got a lot of errors that has the same origin "Fatal error: Call to a member function the_function() on a non-object". The solution to ...
1
vote
1answer
405 views

Access bloginfo, get_option, and plugins_url from a non-core php file

I am creating a plugin that has a php file in the plugin directory which is accessed directly via a custom rewrite url. I need this file to be able to use the three functions mentioned in the title. ...
1
vote
2answers
919 views

external wordpress pages using wp-blog-header

I am setting up a few sections of a website external to the core wordpress installation, but I still want to use the built in wpdb functions, and/or header files from wordpress. I follow the ...
7
votes
2answers
7k views

What is the correct way to use wordpress functions outside wordpress files?

I read about 2 methods for initializing wordpress function outside of wordpress files so We can use these functions on any page or website outside the wordpress blog. Which one of these 2 methods is ...
0
votes
1answer
125 views

Why does WP load so many files in the head of source code? How do I optimize it?

I have noticed that wordpress loads a bunch of files into the head of a site. This looks really sloppy and discloses vital information about the file structure of a website. Depending how many ...
0
votes
2answers
3k views

Load Next WordPress Posts With AJAX?

I found an amazing plugin that loads the next posts with Ajax. http://www.problogdesign.com/wordpress/load-next-wordpress-posts-with-ajax However it doesn't work with custom post types. The code ...
2
votes
1answer
191 views

How do you load WordPress from an external script when using MultiSite? [duplicate]

Possible Duplicate: Using WordPress functions on other sites I have an external script that needs to load up WordPress in order to have access to WordPress functionality. In the past I ...
1
vote
1answer
987 views

wp_enqueue_style with style.php and Wordpress functions

I use wp_enqueue_style to add my stylesheet, like this: <?php wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/style.php', false, '1.0', 'all' ); ?> It works fine BUT I need ...
1
vote
1answer
2k views

Include CSS with PHP without including wp-load?

I have a CSS-file generated from PHP. In my file it says... header("Content-type: text/css"); define('WP_USE_THEMES', false); include '../../../../wp-load.php'; I've read that including ...
1
vote
2answers
798 views

Initialize WordPress environment to use in a real cron script

I have to run a PHP script through real cron (WP cron being too unreliable). Within that script, I need $wpdb to insert data into WordPress table. But of course $wpdb will not be available as ...
3
votes
1answer
1k views

What is the very earliest action hook you can call?

After the solution to this question was to get a function to launch BEFORE the init action is fired by taking the sequence out of its function, it got me thinking, is there any earlier in the WP load ...
0
votes
1answer
610 views

Loading wp-load.php in an external PHP file throws unknown error

I'm loading wp-load.php in order to access WP functions inside of a PHP file that I'm using to process form submissions. Everything works perfectly fine on localhost and every server I've tested ...
-1
votes
2answers
3k views

Call to undefined function issue

I know there are other, maybe better ways to do what I want to achieve, but I have to use this solution. I have two stylesheets: style.css - normal stylesheet style-dynamic.php - dynamic stylesheet ...
4
votes
4answers
1k views

What is the best way to load the WP environment in a subdomain of my multisite Wordpress install?

I have a subfolder install of WP multisite, let's say at "domain.com". I now need to load the WP environment in subdomains of domain.com, say "sub1.domain.com", "sub2.domain.com", ... ...
0
votes
1answer
363 views

Subdomain redirect problem

Wordpress is installed my root directory(/root/). I have a subdomain(dammani.techbrij.com) and I want to access some files of main domain from sub domain. I have done following thing: ...
3
votes
2answers
2k views

Displaying content from one WP site on separate WP site

I have two totally separate WP websites setup. Different domains, different databases. I manage both of them and they are both hosted on a dedicated server. I am trying to include some basic ...