raw code vs wordpress

I think your question conflates design and development, though they’re not even close to the same thing. Sites are rarely “designed from code”…they’re designed in Photoshop by designers and translated into code by developers (of course, there are exceptions to this, but it’s usually the case). But I’ll assume you’re just saying, “since WordPress does … Read more

Include print style sheet

Use wp_enqueue_style to add a print stylesheet, note the media parameter that lets you make it a print-specific stylesheet: function wpa_print_styles(){ wp_enqueue_style( ‘wpa-print-style’, get_stylesheet_directory_uri() . ‘/print-style.css’, array(), ‘20130821’, ‘print’ // print styles only ); } add_action( ‘wp_enqueue_scripts’, ‘wpa_print_styles’ );

Woocommerce include custom stylesheet after woocommerce styling [closed]

wp_enqueue_style supports dependencies. So, if you make the WooCommerce style a dependency for your new stylesheet then your stylesheet will always load after the WooCommerce stylesheet. Something like this ought to work, but it is untested: function enqueue_style_after_wc(){ $deps = class_exists( ‘WooCommerce’ ) ? array( ‘woocommerce-layout’, ‘woocommerce-smallscreen’, ‘woocommerce-general’ ) : array(); wp_enqueue_style( ‘my-style’, ‘my-style.css’, $deps, … Read more

Sticky navigation and the wpadminbar

You should be able to keep the wpadminbar from overlaying your navigation bar by using either JavaScript or a combination of PHP and CSS. I would add this php to the header.php file of your theme: <?php if ( is_admin_bar_showing() ) { ?> <style> .my-nav-bar { position: absolute; top: [wpadminbar-height]px; } </style> <?php } ?> … Read more

Assets in css dont link properly in pages other than home

You’re using relative URLs that will always look inside the current URL structure. You either need to add a slash before wp-content, or put in the full URL to the resources. So for example: src: url(‘/wp-content/themes/mytheme/fonts/font.ttf’); or src: url(‘http://example.com/wp-content/themes/mytheme/fonts/font.ttf’);

How to dequeue styles coming from plugins?

You’re on the right track, but you need to know the stylesheet’s ID. It’s not necessarily the same as the stylesheet’s filename. Check the generated source of your page (ie, load the page up in a browser and View Source). Find the <link> tag that’s loading the stylesheet. If it’s been properly enqueued for WordPress, … Read more

get_stylesheet_uri returns wrong path

I don’t think you want get_stylesheet_uri, which will return the complete stylesheet URL including style.css. You want get_stylesheet_directory_uri, which will give you the path up to the child/parent theme stylesheet directory but not the trailing style.css, and which is the function used by the Roots theme per the code you posted. wp_enqueue_style(‘fsc’, get_stylesheet_directory_uri().’/abcdefg.css’, false, null); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)