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
$args = array( | |
'post_type' => 'product', | |
'posts_per_page' => 12, | |
'order' => 'desc', | |
'orderby' => 'date', | |
'paged' => (get_query_var('paged') ? get_query_var('paged') : 1) | |
); | |
$post_query = new WP_Query($args); | |
if($post_query->have_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
// Creating the widget | |
class spacer_widget extends WP_Widget { | |
function __construct() { | |
parent::__construct('spacer_widget', __('Spacer', 'spacer_widget_domain'), array( 'description' => __( 'Spacer widget', 'spacer_widget_domain' ))); | |
} | |
public function widget( $args, $instance ) { | |
$space_px = apply_filters( 'space_px', $instance['space_px'] ); | |
echo $args['before_widget']; |
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
// Disable Google Fonts in Elementor | |
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' ); |
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( 'admin_bar_menu', 'remove_wp_nodes', 999 ); | |
function remove_wp_nodes() | |
{ | |
global $user_ID; | |
global $wp_admin_bar; | |
if ( current_user_can( 'editor' ) ) { | |
$wp_admin_bar->remove_menu('wp-logo'); | |
$wp_admin_bar->remove_menu('comments'); |
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
sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs | |
sudo find /opt/bitnami/apps/wordpress/htdocs -type d -exec chmod 775 {} \; | |
sudo find /opt/bitnami/apps/wordpress/htdocs -type f -exec chmod 664 {} \; |
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( 'woocommerce_check_cart_items', 'mandatory_coupon_for_specific_items' ); | |
function mandatory_coupon_for_specific_items() { | |
$targeted_ids = array(37); // The targeted product ids (in this array) | |
$coupon_code = 'summer2'; // The required coupon code | |
$coupon_applied = in_array( strtolower($coupon_code), WC()->cart->get_applied_coupons() ); | |
// Loop through cart items | |
foreach(WC()->cart->get_cart() as $cart_item ) { | |
// Check cart item for defined product Ids and applied coupon |
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
<form class=" woocommerce-cart-form"> | |
... | |
<input type="hidden" id="cart_extra_option" name="cart_extra_option" value="value" > | |
<input type="hidden" id="cart_total_price" name="cart_total_price" value="value"> | |
... | |
</form> |
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 ( is_active_sidebar( 'sidebar-1' ) ) : ?> | |
<div id="secondary" class="widget-area" role="complementary"> | |
<?php dynamic_sidebar( 'sidebar-1' ); ?> | |
</div> | |
<?php endif; ?> |
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
//remove_action( 'wp_head', 'wp_enqueue_scripts', 1 ); | |
remove_action( 'wp_head', 'feed_links', 2 ); | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); | |
remove_action( 'wp_head', 'rsd_link' ); | |
remove_action( 'wp_head', 'wlwmanifest_link' ); | |
remove_action( 'wp_head', 'index_rel_link' ); | |
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); | |
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); | |
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); |
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
<link rel="stylesheet" type="text/css" href="https://widget.reviews.co.uk/floating-widget/css/dist.css"> | |
<script src="https://widget.reviews.co.uk/rich-snippet-reviews-widgets/dist.js" type="text/javascript"></script> | |
<script> | |
window.onload = function() { | |
richSnippetReviewsWidgets({ | |
store: "<store-name>", | |
primaryClr: "#f47e27", | |
widgetName: "floating-widget", | |
numReviews: 40, | |
floatPosition: "right", |