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

How to clean background captcha image using imagick
How can I get Magento Each Session values by using Magento frontend cookie value through Web Service?
WooCommerce displaying variable description after variable price
if else condition in jquery ajax response
php fastcgi is crashing if the url contains &start_debug=1
Having issue modifying theme code to replace logo URL
Combination of php_opcache and IIS causing intermittent 500 errors
DOMPDF class not found
wordpress APi integration
How Remove extra tag in xml in php
How to add a custom year drop-down in place of Export CSV drop-down on admin panel for custom grid and filter the collection?
Sending boolean values with $.ajax to PHP
Loop row in bootstrap every 3 columns
Get friends name/id list form graph api into array
LAMP shows index.php in var/www/html instead of project
How To play 25MB+ audio file directly from google drive in HTML 5?

Categories

HOME
office365
visual-studio
events
windows-8.1
slider
cryptography
facebook-android-sdk
tup
lda
heuristics
match
chromecast
webstore
squid
pygobject
android-5.1.1-lollipop
l20n
http-authentication
spam
parceler
jest
angular2-highcharts
connection-refused
stackexchange.redis
software-packaging
vuforia
tortoisemerge
tracing
plyr
spreadsheetgear
msdeploy
react-bootstrap-table
sales
fatfs
winsock
infopath2010
windows2012
rust-cargo
private-key
sql-execution-plan
ms-media-foundation
cloveretl
java-stream
testlink
twilio-php
variable-variables
assert
selenide
secure-coding
spooler
web-inspector
flume-twitter
gcal
adblock
rightnow-crm
password-hash
jgrapht
sharpdx
solr-query-syntax
simple-schema
watir-webdriver
exc-bad-access
sesame
swiperefreshlayout
email-injection
portal
deviare
visual-studio-monaco
always-on-top
mathml
jemdoc
as3-api
openmrs
django-validation
diawi
apple
vdm-sl
angular-amd
quercus
fuseesb
nsmutabledata
htmltidy
maven-shade-plugin
fat32
microsoft-expression-web
famo.us
dc
zend-mail
stripe.net
incognito-mode
lru
.net-remoting
bcdedit
spiral
django-filebrowser
contextswitchdeadlock
cyrillic
playorm
nsmutablestring
getopt-long
fitch-proofs
servercontrol
uipasteboard
fragment-identifier
git-log
aggregator
icicles
self-tracking-entities
zend-test
rakudo
stretchblt
word-automation

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App