in my custom page I use wp outside wp core like this
<?php
//define('SHORTINIT', true);
define('WP_USE_THEMES', FALSE);
require_once('../../wp-load.php');
global $wpdb;
if(!current_user_can('commerciali') && !current_user_can('administrator')){
wp_redirect('/login/?user_redirect='.$_SERVER['SCRIPT_URI']);
die();
//wp_die("Non hai accesso alla pagina","ERRORE");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
Test
</body>
</html>
Why if I don’t use get_header and WP_USE_THEMES is set to false in source code I’ve this:
<!DOCTYPE html><html lang="en"><head><link rel="stylesheet" type="text/css" href="https://www.piuchepuoi.it/assets/cache/minify/000000/21108/default.include.b9b46f.css" media="all" /><script type="text/javascript">function w3tc_load_js(u){var d=document,p=d.getElementsByTagName('HEAD')[0],c=d.createElement('script');c.type='text/javascript';c.src=u;p.appendChild(c);}</script><script type="text/javascript">w3tc_load_js('https://www.piuchepuoi.it/assets/cache/minify/000000/21108/default.include.f44574.js');</script><meta charset="utf-8"></head><body> Test<script type="text/javascript">w3tc_load_js('https://www.piuchepuoi.it/assets/cache/minify/000000/21108/default.include-footer.99b7d3.js');</script></body></html>
Why W3 Total cache load script and style?
Can you help me? Thanks
https://www.ads-software.com/plugins/w3-total-cache/
]]>– When I logout the browser shows a blank page
– When I try to login it tells me I need to activate the Cookies
– The Login only works when I change the theme’s name fia FTP (as soon as I am logged in I can change it back)
It also displays blank pages when I activate/deactive a plugin or change the settings in the dashboard.
I inserted this code in the index.php in the blankslate folder to find the problem:
<?php ini_set('display_errors','1'); ini_set('display_startup_errors','1'); error_reporting (E_ALL);include('index.php'); ?>
and it tells me the following:
” Notice: Constant WP_USE_THEMES already defined in /usr/www/users/piadin/index.php on line 14 “
I did not change anything in the index.php in the parent directory, neither did I use the variable WP_USE_THEMES anywhere else (At last not consciously…).
What I already tried:
– I deactivated the Plugins one by one
– I changed the name of the Plugin Folder
It didn’t change a thing, so I think the problem lies within my changes in the PHP Documents in the Theme’s folder.
Link to the Webpage: https://piadinabar.de/
Any help is kindly appreciated!
]]>Is there something obvious I’m missing?
(Edited to add: I was following the instructions here.)
]]>/** * Front to the WordPress application. This file doesn’t do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define(‘WP_USE_THEMES’, true); /** Loads the WordPress Environment and Template */ require(‘./wp-blog-header.php’);
I do a reinstall of WordPress, everything is fixed. A few days to a week later, the sites break again and the message appears again……
Please help if you have any idea what is going on: https://www.aokengroup.com
]]>add_action( 'template_redirect', array( &$this, 'queue_slider' ) );
to
add_action( 'wp_loaded', array( &$this, 'queue_slider' ) );
got it working, and it doesn’t seem to affect anything else. Could this perhaps be changed in the package, meaning that it doesn’t break when I upgrade?
https://www.ads-software.com/plugins/header-image-slider/
]]>I need this functionality for generating a dynamic css stylesheet with global variables as described here: Accessing global variable in “CSS” (style.php).
To sum it up a bit: The code
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
was used before to enable wp functionality in 3rd party scripts. In this special case it was possible to use wp global variables in css when added to a dynamic stylesheet, for example style.php. But since 3.0 this code doesn’t work in the same way anymore, it breaks the whole css instead.
What is the code to call wp functionality here now?
]]>In particular, the page www.tinyblue.com/htm/observations.php accesses my WordPress database sucessfully using an ultra-simple loop (similar to https://codex.www.ads-software.com/Integrating_WordPress_with_Your_Website#Examples).
I want to replace that loop with a simple theme (which I have created by slightly modifying kubrick). The theme works at www.tinyblue.com/wordpress/index.php
I thought perhaps that I could simply change “false” to “true” in the line within observations.php:
‘define(‘WP_USE_THEMES’, false);
but that doesn’t work.
What do I need to do so that my theme, installed at
www.tinyblue.com/wordpress/wp-content/themes/default/ will be expressed in my page observations.php?
Thank you for any leads you may have.
]]>define('WP_USE_THEMES', false);
This configuration will be lost once an upgrade is performed – Isn’t there an option to do it with wp_options database table?
]]>define(‘WP_USE_THEMES’, false);
require(“/home/domain/public_html/wp-blog-header.php”);
But in 3.0.1 something changed and that same code, when added to a 3rd party script now, breaks it in a way that it doesn’t wrap their code into WP one anymore, but it either opens up a /3rd-party-script-folder/wp-admin/install.php or it doesn’t even open up the file requested in /3rd-party-script-folder and returns a 404 error.
What changed to cause this?
I mean, this might still work just fine for simple implementations without much authentication/cookies/session variable programming, but this 3rd party script developers team hasn’t been able to figure out what’s wrong and their only answer after a week straight of looking at it is to ask around here…
]]>I have a site that I am building using WordPress as a CMS. Due to an unconventional approach to page loading, I was unable to get the site to behave as a WordPress theme.
However, by including “wp-load.php” in my file I’ve been able to query and build pages using WordPress content while keeping the custom functionality.
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('path to/wp-load.php');
?>
The challenge remaining is that galleries don’t load properly, and I’m assuming any other content included in WP posts by use of a plugin will have the same problem. Is there a way to enable the use of WP plugins outside of a WP theme and outside of the WP directory?
I am currently using Cleaner Gallery, and I imagine I’ll be using Shadowbox and some other plugin for videos.
A working test gallery in WordPress is here: https://u.nu/2xykd
That gallery as it appears in the site: https://u.nu/2czkd (select page “2” from the temporary nav at top-left)
Any help is appreciated!
John