Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

0

You cannot add fill to a path in a svg that has been converted to base64 like you normally do with inline svgs. Either add the fill before conversion to base64, or add it like this in your current css: fill='%23f00' The above is equivalent to fill='#f00'. This goes also for stroke, basically replace # with %23 in base64. Stroke example: stroke='%23f00' ...


0

You are using cropped image. Your image is 300x300 cropped while the section is bigger. Your first div is already set to 40% width, so limiting the image to 40% in that section doesn't make sense. Use properly sized thumbnail or actual image. Here is the result i got using actual image /3dcc1cba-c209-4a1a-a1f2-edd17fc8b58e.jpg & NOT 3dcc1cba-c209-4a1a-...


0

There's a specific hook you can use for the theme's stylesheet, stylesheet_uri: function wpse350851_override_stylesheet_uri( $stylesheet, $stylesheet_dir ) { return 'http://external-host.com/css/style.css'; } apply_filter( 'stylesheet_uri', 'wpse350851_override_stylesheet_uri', 10, 2 ); Note you probably need to switch between HTTP and HTTPS URLs e.g. ...


0

From what I understood you want to override some particular CSS properties from style.css of a WordPress theme. There might be two different situations here which needs different solutions: If you are developing your own theme then you can simply edit your functions.php inside your theme files and add any JS or CSS file that you want like this: ...


0

If this is your own theme (that you made) I have some suggestions. If the theme is third-party, I suggest making a child theme (lots of helpful advice on Google about this). As you are using a cookie to pick light or dark, you should be able to hook the enqueued styles and dequeue the unwanted one with the style_loader_tag filter. add_filter( '...


0

if you add pages via add_menu_page or add_submenu_page, and only need your css there, those function return a hook, which you can use with the load-$your_hook action. And with said hook, you can load your css only on this specific page. for example: add_action( 'admin_menu', 'register_page'); function register_page() { $my_hook = add_menu_page( 'tab ...


0

You can try fragment caching (https://www.justinsilver.com/technology/wordpress/w3-total-cache-fragment-caching-wordpress/)


0

Here is an other interesting article that makes a decent job of listing all the available css classes/html markup one can use in styling an admin page. The articles is a little outdated in that it show styling results from older version of WordPress, so its likely that additional classes have been added since. Another useful resources are the WordPress ...


0

Normally the quickest way is to go to Appearance > Themes > Customise (on your theme). This allows you to insert custom CSS. I usually prefer to create a child theme and either override the header.php file by copying it into the child theme in the same folder location. Or enqueue the stylesheet using functions.php in your child theme. The child theme ...


0

// add body class for that. add_filter( 'body_class', 'custom_class' ); function custom_class( $classes ) { if ( is_single() && 'post' == get_post_type() ) { $classes[] = 'article-page'; } else{ if(!is_page('library')) $classes[] = 'home'; } if(is_page('contact-page')){ $classes[] = 'contact-page'; } if(...


0

You want to add different CSS class on different page. You can do it by checking it by page or page id. It's going to bit long work for you. However, you can do it two way. (May be more ways are there but I suggest you these two) For both you should have added following code into active theme's header file where you render body tag <body <?php ...


1

In your functions.php: function my_body_class($classes) { if(is_page()){ global $page; $title = get_the_title( $page ); $classes[] = $title; } return $classes; } add_filter('body_class', 'my_body_class'); That will add the page title as a class to each page.


2

Couple of options for you. Option 1: Use the body_class() function to add the page slug to the class. function add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_name; } return $classes; } add_filter( 'body_class', 'add_slug_body_class' ); Then whatever the url is, say "yourdomainpage.com/...


0

You are resizing your logo in your css, giving that flash of unstyled content on load/reload. It's original size is 150x150px. You have at least two options: Change it for a smaller version (75x75px), avoiding the jarring resize. Alter the css to make it display:none (like your other logos) and make it fade in with javascript. Give these a try.


3

Mostly no, but you shouldn't do that anyway. The exception, is if your user has the unfiltered_html capability, which is a dangerous power to have. Users that have this are admins on a single site install, or a super admin on a multisite install. But, there are major security downside to putting script and style tags directly into articles. For CSS, it's ...


0

If you are a theme developer, you might want to force reload of your assets when you push new version. So versioning of a theme is done in style.css /* Theme Name: Your Theme Name Version: 1.0.2 */ At the top of your functions.php: $theme = wp_get_theme(); define('THEME_VERSION', $theme->Version); //gets version written in your style.css ...


0

This is more of an html question but, you'd have to write a theme, or at least a child theme. An absolutely terrible way to do this would be with tables ... but, that'd probably be the easiest way. Something more like this would be sufficient: <div class="row">title 1, title 2</div> <div class="row">image 1, image 2</div>


0

In your functions.php file (you're using a custom child theme, right?) change/add the version parameter to wp_get_theme()->get( 'Version' ) this will pull the version number from your theme's style.css file. https://developer.wordpress.org/reference/functions/wp_enqueue_style/ Setting this parameter to false will use the WordPress version. ...


0

It's using 5.2.3 because no version was specified when style.css was enqueued/registered. So it fell back to the version of WordPress. If you pass in a version when calling wp_enqueue_style, it will use that value instead


-1

Change the version number in your style.css file. Edit: I misunderstood. I think that's the WordPress version.


0

You're using the incorrect hook. The only hook is wp_enqueue_scripts (plural). You use wp_enqueue_style() and wp_register_script() etc. on that hook, but the hook is always the same. So this: add_action('wp_enqueue_script' , array( $this, 'initBootstrap' )); add_action('wp_enqueue_style' , array( $this, 'initBootstrap' )); add_action('wp_register_script' , ...


0

Instead of setting up margin/padding. Try setting up max-width of full-container a <div> next to site-main: body.responsive.layout-full #page-wrapper .full-container { max-width: 95%; margin-left: auto; margin-right: auto; } You can change max-width to your desired percentage value.


0

For some reason, there's a display none on the :before of your button. The following should fix this. .woocommerce-page ul.products li.product .button.add_to_cart_button:before, .woocommerce ul.products li.product .add_to_cart_button:before { display: block; }


0

You didn't mention the library you're using to generate this meta, but i guess it's the cmb2 library, if it's so then you should change your array params as follow : array( 'label' => esc_html__( 'Property Lot Size', 'zoacres' ), 'desc' => esc_html__( 'Enter lot size of property by number. Do not use any special characters like comma, dot ...


Top 50 recent answers are included