How to properly escape in ternary operators – Wp Coding Standards?
How to properly escape in ternary operators – Wp Coding Standards?
How to properly escape in ternary operators – Wp Coding Standards?
I got the solution as @Sally CJ posted comment in my question. Setting quicktags to true did the job for me.
It’s not really the Customizer that stores the changes, sort of. All changes to a theme’s settings are done by the theme settings code, and are stored (usually) in the wp-options table (although a theme might have it’s own table where it stores settings). So, if you make changes via the theme’s Customizer interface, the … Read more
Conceptually wp_add_inline_style adds some lines as if they were concatenated to a style file. This means that your setup will only work if you are adding the inline style to a style file loaded in the footer, because by the time you are calling add_inline_style in a template the header has already been assembled. That … Read more
remove_action(‘genesis_header’,’genesis_do_header’) hook not working
Well, previous developer was a little bit naughty (;)) and used PHP short tags, which is a bad practice… And even worse – he used them a little bit wrong, I guess… As you can see, there is something like this in your code: style=”<?print implode(‘;’,$styles); ?>”> Of course there is no such thing like … Read more
You have the global WP_Post object available so you can look the post type like this: function wrap_post_images_to_div( $content ) { if ( get_post()->post_type === ‘post’ ) { $pattern = ‘/(<img([^>]*)>)/i’; $replacement=”<div class=”well text-center”>$1</div>”; $content = preg_replace( $pattern, $replacement, $content ); } return $content; } add_filter( ‘the_content’, ‘wrap_post_images_to_div’ ); You can use the preg_replace_callback instead … Read more
The .widget-area actually IS inside .site-content. For anyone wondering why .content-area has a <main> child-element, rather than being the <main> element itself, here is the explanation: It allows for CSS styling while preserving HTML5 semantics. Namely it allows for easier negative margin management as well as background and other styling (full explanation here).
It’s hard to say without seeing the actual live page but it may be as simple as adding the following to your theme’s style.css file: .penci-topbar-social { float:left; } You don’t always need to modify where something fires to visually move where it is displayed within the page.
First off, check with your plugin provider. You should never duplicate a child theme for A/B testing purposes – it will not work – and you shouldn’t have to go to this drastic length for such a simple change. If this is the only way they offer to A/B test, find a different plugin/testing provider. … Read more