Load files content [closed]

You should use WordPress’s built in function wp_enqueue_style for loading styles. /** * Proper way to enqueue scripts and styles */ function wpdocs_theme_name_scripts() { wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/example.js’, array(), ‘1.0.0’, true ); } add_action( ‘wp_enqueue_scripts’, ‘wpdocs_theme_name_scripts’ ); https://developer.wordpress.org/reference/functions/wp_enqueue_style/

Load a Header in wordpress

You’re really close – get_header_image() returns the URL of the image, whereas header_image() echo’s out the URL. Because you’re setting your style tag in a variable and then echo’ing that, you need to use the function that returns the header image URL – so, like this: $banner=”style=”background-image:url(“. get_header_image() .’);”‘; Using header_image() will, as you found, … Read more

Query category name by variable

It seems that you miss some PHP basics? http://php.net/manual/en/language.operators.string.php Anyhow, This $post_categoria = new WP_Query(‘category_name=name-category’); Should become this: $post_categoria = new WP_Query(‘category_name=” . $nisola);

How do I reformat this to add php inside php?

As PHP documentation says Often you’d want to have more than one statement to be executed conditionally. Of course, there’s no need to wrap each statement with an if clause. Instead, you can group several statements into a statement group. So You have to use curly braces {} to add more statement within if else … Read more

Display Sale Price Before Regular Price (WooCommerce)

You have to change this in functions.php if (!function_exists(‘my_commonPriceHtml’)) { function my_commonPriceHtml($price_amt, $regular_price, $sale_price) { $html_price=”<p class=”price”>”; //if product is in sale if (($price_amt == $sale_price) && ($sale_price != 0)) { $html_price .= ‘<ins>’ . wc_price($sale_price) . ‘</ins>’; $html_price .= ‘&nbsp;&nbsp;<del>’ . wc_price($regular_price) . ‘</del>’; } //in sale but free else if (($price_amt == $sale_price) … Read more