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
mklink /j "C:\laragon\www\test-multi\wp-content\plugins" "C:\laragon\www\test\wp-content\plugins" | |
First folder will be a link to the second folder. |
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
$site_domain = wp_parse_url( site_url(), PHP_URL_HOST ); // site.com |
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
// canonical для страниц пагинации | |
function change_yoast_canonical( $canonical ) { | |
if ( is_paged() AND is_archive() ) | |
$canonical = preg_replace('/\/page\/.*/', '', $canonical); | |
return $canonical; | |
} | |
add_filter( 'wpseo_canonical', 'change_yoast_canonical', 10, 1 ); |
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', |
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
PHPSTORM: | |
settings/terminal | |
shell path: C:\Windows\System32\bash.exe |
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 | |
/** | |
* Display image with all attributes | |
* Function uses Kama Thumbnail plugin to crope images | |
* | |
* @param int $id attachment id | |
* @param string $kama_args string of arguments for kama_thumbnail | |
* @param string $classes list of classes separated by space | |
* @param string $alt custom alt for image | |
* @param string $title custom title for image |
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
<?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
<?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; |
NewerOlder