Skip to content

Instantly share code, notes, and snippets.

View rodica-andronache's full-sized avatar
🦄

Rodica-Elena Irodiu rodica-andronache

🦄
  • themeisle.com
  • Bucharest
View GitHub Profile
.wc-block-components-notice-banner.is-success {
border-radius: 3px !important;
background: #182727 !important;
border: 0 !important;
color: #fff !important;
font-size: 16px !important;
}
.wc-block-components-notice-banner.is-success>svg {
background-color: #ffffff !important;
@rodica-andronache
rodica-andronache / gist:42b57f63006466678200feb84f72a82e
Created May 12, 2017 14:00
How to use filters with parameters
In the parent theme
--------------------
Apply the same filter in multiple places, but with different parameters:
apply_filters ( 'xxx_filter_name', 'value_to_be_filtered_1', 'parameter_1a', 'parameter_2a' )
apply_filters ( 'xxx_filter_name', 'value_to_be_filtered_2', 'parameter_1b', 'parameter_2b' )
The hestia_pagination() function in inc/template-tags.php should be replaced with the core the_posts_pagination() function.
See: https://developer.wordpress.org/reference/functions/the_posts_pagination/
You can customizer the markup via this hook: https://developer.wordpress.org/reference/hooks/navigation_markup_template/
If what you want to do can't be accomplished with the core functions and hooks, be sure to make a note of that explaining it in your inline PHP comments accompanying the function. It'll help the .ORG reviewers know you need to do something custom.
Otherwise, I strongly recommend using the core function.
@rodica-andronache
rodica-andronache / gist:8a84147b4151bccd99c61ad020e295b8
Created February 27, 2017 13:41
Multiple-level of panels in customize
In customizer.php:
<?php
if ( class_exists( 'WP_Customize_Panel' ) ) {
class PE_WP_Customize_Panel extends WP_Customize_Panel {
public $panel;
@rodica-andronache
rodica-andronache / gist:1be36acd064b0314f7bce8b4ae990f3e
Created February 22, 2017 15:39
Shiny install/updates for plugins
public function style_and_scripts() {
...
wp_enqueue_style( 'plugin-install' );
wp_enqueue_script( 'plugin-install' );
wp_enqueue_script( 'updates' );
...
}
public function create_action_link( $state, $slug ) {
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
Exemplu:
http://img.youtube.com/vi/82W503BSF10/0.jpg
And for Vimeo, we can get like this:
http://vimeo.com/api/v2/video/<video-id>.json
@rodica-andronache
rodica-andronache / gist:d192e9bc7ee13a9926e5ce787800cb96
Last active September 5, 2016 08:03
Migrate old favicon to new favicon option from core
function bookrev_migrate_favicon(){
if ( function_exists( 'wp_site_icon' ) ) {
if ( get_theme_mod('old-favicon-image') ) {
$id = attachment_url_to_postid( get_theme_mod('old-favicon-image') );
if ( is_int( $id ) ) {
update_option( 'site_icon', $id );
}
remove_theme_mod( 'old-favicon-image' );
}
}
@rodica-andronache
rodica-andronache / gist:9101ff8f9852242c97c53845498c56d0
Created August 3, 2016 13:49
WordPress enqueue style/script only for IE later than 9
wp_enqueue_style('zerif_ie_style', get_template_directory_uri() . '/css/ie.css', array('zerif_style'), 'v1');
wp_style_add_data( 'zerif_ie_style', 'conditional', 'lt IE 9' );
wp_enqueue_script( 'zerif_html5', get_template_directory_uri() . '/js/html5.js');
wp_script_add_data( 'zerif_html5', 'conditional', 'lt IE 9' );
@rodica-andronache
rodica-andronache / gist:348e513769d318e23e82
Last active January 29, 2016 09:20
WooCommerce tricks
-> Remove formularul pentru cupon pe pagina de checkout:
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 )
-> Remove login form de pe pagina de checkout:
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_login_form', 10 );
-> Move coupon code form on checkout page, after the "Your order" table:
@rodica-andronache
rodica-andronache / gist:16812dbf313e0eb452a1
Created May 27, 2015 11:53
TRADUCERI cu wpml/polylang pentru campurile din customizer
https://wpml.org/documentation/support/language-configuration-files/
Creez un fisier wpml-config.xml de genul:
<wpml-config>
<admin-texts>
<key name='theme_mods_zerif-lite'>
<key name='zerif_copyright' />
<key name='zerif_socials_facebook' />
<key name='zerif_socials_twitter' />