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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = 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
<?php | |
class Elementor_Custom_Widget extends \Elementor\Widget_Base { | |
/*================================= | |
Single condition:- | |
====================================*/ | |
/*================================= | |
Credit: Eqbal Rony | |
original gist: https://github.com/iqbalrony/elementor-conditions/blob/master/conditions.php | |
====================================*/ |
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_filter('show_admin_bar','codingeek_show_admin_bar'); | |
function codingeek_check_user_validation(){ | |
$current_user = wp_get_current_user(); | |
if ( in_array('subscriber', $current_user)) { | |
//have to write code for subscriber | |
show_admin_bar( false ); // for hide adminbar | |
}; |
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 | |
/** | |
* Fix for Elementor template conditions not compatible with Polylang (you need to save again one of your templates to make it work, after putting this function in your plugin/theme) | |
* Needs to be priority 1, since Polylang uses the action parse_query which is fired before pre_get_posts | |
* | |
* @link https://github.com/polylang/polylang/issues/152#issuecomment-320602328 | |
* | |
* @param WP_Query $query | |
*/ | |
function polylang_elementor_library_conditions_parse_query( $query ) { |
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 | |
/** | |
* Yoast Schema: Remove datePublished on WebPage | |
* | |
* @param array $schema | |
* | |
* @return mixed | |
*/ | |
function custom_wpseo_schema_webpage( $schema ) { |
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 LocalBusiness to schema Organization | |
* | |
* @api array $data The graph piece to filter. | |
* | |
* @return array | |
*/ | |
function custom_wpseo_schema_organization($data){ | |
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 | |
/** | |
* WooCommerce: Adds Brand attribute to "Product" Structured Data | |
* | |
* @param array $data | |
* | |
* @return array | |
*/ | |
function woocommerce_structured_data_product_brand ($data) { | |
global $product; |
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 | |
/** | |
* WooCommerce Scheduled Sales: everyday, sales start, cache should be emptied (WP Rocket) | |
* | |
* @since 1.0.9 | |
*/ | |
function woocommerce_scheduled_sales_empty_wprocket_cache(){ | |
// Clear WP Rocket Cache (whole site) | |
if ( function_exists( 'rocket_clean_domain' ) ) { |
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 | |
/** | |
* Elementor get polylang translation of template | |
*/ | |
add_filter( 'elementor/theme/get_location_templates/template_id', function( $post_id ) { | |
if(!is_admin()){ | |
if ( function_exists( 'pll_get_post' ) ) { |
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 | |
/** | |
* Polylang Shortcode - https://wordpress.org/plugins/polylang/ | |
* Add this code in your functions.php | |
* Put shortcode [polylang_langswitcher] to post/page for display flags | |
* | |
* @return string | |
*/ | |
function custom_polylang_langswitcher() { | |
$output = ''; |
OlderNewer