php


Where is this stylesheet being loaded from?


I am having a problem with a site I am developing with wordpress.
It happened after upgrading to the latest version (4.7)
Anyway. Go to the site www.scientized.com (just dummy content for now), and go the source. At around line 124 you see the tag <style type="text/css" id="wp-custom-css"> and then after some css is loaded.
The thing is, is that this some of my old css code from way early. To make life easier and to isolate the problem I have delete all css in my child themes style.css as well as the custom css in the customizer, and delete jetpack just to be sure. Yet this css is being loaded from somewhere. I have file explored the crap out of my site trying to find where this is located, but couldn't find anything.
I have found that in the wp-includes/theme.php there is this function:
function wp_custom_css_cb() {
$styles = wp_get_custom_css();
if ( $styles || is_customize_preview() ) : ?>
<style type="text/css" id="wp-custom-css">
<?php echo strip_tags( $styles ); // Note that esc_html() cannot be used because `div > span` is not interpreted properly. ?>
</style>
<?php endif;
}
so this wp_get_customer_css() function is calling the old css from somewhere -- I tried to follow the functions back to see where - but my php is not that good and got lost. Does anyone know where this is being loaded from?
I think I need to know where the JetPack custom css location is. I have read it is generated dynamically -- so I am not sure how to go about the problem.
Edit: I dont get the text box in the custom css area in customizer. Where is this text located?
Edit: I dont get the text box in the custom css area in customizer. Where is this text located?
The Additional CSS content is stored in wp_posts database table as a separate record. It's post_type is set to custom_css. To find which post is assigned to the field, you need to look in the option theme_mods_{your theme's slug}.
For example, here is the one from my test Sandbox site which is running the Genesis Sample theme. The post ID is 31, per the key custom_css_post_id.
How do I check my site?
You can go directly into your database via phpMyAdmin and look in the wp_options table. Or...you can do this:
add_action( 'init', 'check_custom_css_post_id_theme_mod' );
function check_custom_css_post_id_theme_mod() {
var_dump( get_theme_mods() );
}
The above code will display the theme mods for your current theme. Note the one that is keyed as 'custom_css_post_id'. That one holds the ID to the post for the CSS.
How to Remove It
To remove a theme mod, you use remove_theme_mod( 'custom_css_post_id' );. See codex for the documentation on this construct. It will remove the binding between the Additional CSS. How? It deletes the sub-option.
Note, it does not delete the post record, meaning you'll have an orphaned record in wp_posts.

Related Links

AJAX only access
resize animated GIFs with phpthumb
regex/php: parse times from string?
How to view DOMNodeList object's data in php
All of a sudden, my Amazon S3 HTTP requests aren't working. Signature Does Not Match error. Help?
Loading Markdownify in CodeIgniter
problem with counterCache of cakePHP
Writing Yahoo! Bot: Why can't I fetch a web page on Yahoo! mail with help of PHP?
selecting results with range + Pythagoras theorem
CakePHP inefficient database queries: can they be avoided?
How to add silverlight player to browser and load our own video using PHP?
Invalid JSON parsing using PHP
How can I extract all integer values from string using a regex?
Zend Framework + Uplodify Flash Uploader Troubles
Text file into an array?
Why does this PHP code hang on calls to mysql_query()?

Categories

HOME
xpath
openshift
knockout.js
tomcat
clearcase
yahoo-weather-api
enums
ews
ant
tcp
gallery
vue-resource
sharepoint-online
yeoman-generator-angular
amazon-emr
android-externalstorage
mailmerge
django-rq
heap-dump
fosuserbundle
maven-plugin
jaspersoft-studio
nose
renderscript
significance
nullreferenceexception
raima
sales
unmarshalling
d3.js-v4
series
knights-tour
jfxtras
microkernel
imgur
right-click
access-denied
permission-denied
apache-toree
nuclio
xcode8.2
spongycastle
uiautomatorviewer
freshdesk
htmlspecialchars
gnome-terminal
popen
predicates
instafeedjs
wildfly-9
gawk
yargs
ternary-operator
yui3
multi-touch
tablespace
xmlbeans
mathjs
livereload
traversable
qtcpsocket
strpos
gwt-syncproxy
psd
cfwheels
highest
cache-manifest
sablecc
mutators
thoughtworks-go
iplimage
inputbox
box2dweb
distributed-r
roxy-fileman
code39
strcmp
ggts
quickgraph
django-filebrowser
first-class
active-record-query
multiple-users
fgetc
wmd-editor
index.dat
datagridcolumn

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App