This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Display Price For Variable Product With Same Variations Prices | |
add_filter('woocommerce_available_variation', function ($value, $object = null, $variation = null) { | |
if ($value['price_html'] == '') { | |
$value['price_html'] = '<span class="price">' . $variation->get_price_html() . '</span>'; | |
} | |
return $value; | |
}, 10, 3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'init', 'set_virtual' ); | |
function set_virtual(){ | |
$args = array( | |
'post_type' => 'product', | |
'posts_per_page' => -1 | |
); | |
$products = new WP_Query( $args ); | |
var_dump(count($products->posts)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Do not copy&paste whole file, find only interesting parts! | |
#HTTP authentification | |
AuthType Basic | |
AuthName "Log in" | |
AuthUserFile /path/to/.htpasswd | |
Require valid-user | |
#Security headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<div class="col-8"> | |
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> | |
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<h2 class="title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> | |
<div class="post-content"> | |
<?php echo the_excerpt();?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: Dummy Theme | |
Theme URI: | |
Author: Toret.cz | |
Author URI: https://toret.cz/ | |
Description: Theme for Metal Trade eshop | |
Version: 1.0 | |
License: GNU General Public License v2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
Text Domain: dummy-theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'dummy_theme_setup' ) ){ | |
function dummy_theme_setup() { | |
// Add theme supports | |
add_theme_support( 'automatic-feed-links' ); | |
add_theme_support( 'title-tag' ); | |
add_theme_support( 'post-thumbnails' ); | |
add_theme_support( 'html5', array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!-- BEGIN html --> | |
<html <?php language_attributes(); ?>> | |
<!-- BEGIN head --> | |
<head> | |
<meta charset="<?php bloginfo( 'charset' ); ?>"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="profile" href="https://gmpg.org/xfn/11"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<div id="primary" class="content-area col-8"> | |
<main id="main" class="site-main" role="main"> | |
<div class="error-404 not-found"> | |
<header class="page-header"> | |
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can’t be found.', 'theme' ); ?></h1> |
OlderNewer