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
<a href="#menu" id="toggle" class="toggle"><span></span></a> | |
<nav id="menu" class="menu"> | |
<ul> | |
<li><a href="/">Menu item 1</a></li> | |
<li><a href="/">Menu item 2</a></li> | |
<li><a href="/">Menu item 3</a></li> | |
</ul> | |
</nav> |
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
//FUNCTION FILE | |
function get_category_tags($args) { | |
global $wpdb; | |
$tags = $wpdb->get_results | |
(" | |
SELECT DISTINCT terms2.term_id as tag_id, terms2.name as tag_name, null as tag_link | |
FROM | |
wp_posts as p1 | |
LEFT JOIN wp_term_relationships as r1 ON p1.ID = r1.object_ID | |
LEFT JOIN wp_term_taxonomy as t1 ON r1.term_taxonomy_id = t1.term_taxonomy_id |
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 | |
add_filter( 'request', function ( $query_vars ) { | |
if ( isset( $query_vars['pagename'] ) && $query_vars['pagename'] === 'all-articles' ) { | |
add_filter( "pre_option_page_for_posts", function () { | |
return 484; // ID нужной страницы | |
} ); | |
} | |
return $query_vars; |
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 | |
/** | |
* Plugin Name: CF7 Modal Right Answer | |
* Plugin URI: https://gist.github.com/campusboy87/a056c288c99feee70058ed24cee805ad | |
* Author: Campusboy (wp-plus) | |
* Author URI: https://www.youtube.com/wp-plus | |
*/ | |
add_action( 'wp_enqueue_scripts', 'wpcf7_modal_right_answer_js' ); | |
add_action( 'wp_footer', 'wpcf7_modal_right_answer_js_inline', 999 ); |
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
/** | |
* Redirect to checkout at add-to-cart action. | |
*/ | |
function redirect_to_checkout() { | |
return WC()->cart->get_checkout_url(); | |
} | |
add_filter( 'woocommerce_add_to_cart_redirect', 'redirect_to_checkout' ); | |
------------------------------------ |
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
<ul class="products"> | |
<?php | |
$args = array( | |
'post_type' => 'product', | |
'posts_per_page' => 12, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'product_visibility', | |
'field' => 'name', | |
'terms' => 'featured', |
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 | |
/** | |
* Plugin Name: Mihdan: Image Placeholder | |
*/ | |
namespace Mihdan_Image_Placeholder; | |
$images = array( | |
// Обычные | |
'https://placeimg.com/640/480/animals', |