This file contains hidden or 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 term page | |
function custom_url_taxonomy_add_new_meta_field() { | |
// this will add the custom meta field to the add new term page | |
?> | |
<div class="form-field"> | |
<label for="term_meta[custom_term_meta]"><?php _e( 'Custom url category', 'custom_url_category' ); ?></label> | |
<input type="text" name="term_meta[custom_term_meta]" id="term_meta[custom_term_meta]" value=""> | |
<p class="description"><?php _e( 'Inserisci un custom url prodotto per la categoria','custom_url_category' ); ?></p> | |
</div> | |
<?php |
This file contains hidden or 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
/*Get the Page id as parameter from the link and fill dropdowns with the custom fields that you need from this page | |
We use gravity forms, and field Product (type dropdown). | |
In this example in pages there are parameters as date1, date2 etc and prices like price (default price) price1, price2 etc. | |
The form with id 3 will be filled with the above parameters and corresponding prices, if there is no corresponding price default price will be filled in. | |
*/ | |
add_filter( 'gform_pre_render_3', 'populate_dates' ); |
This file contains hidden or 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
// Needed this for a client project, thanks! I improved upon it to make it more generic so you don't have to look up individual IDs on elements: | |
jQuery(document).ready(function(){ | |
// Check all in Gravity Forms | |
jQuery('.checkall li:first-child input').click(function() { | |
jQuery(this).parent('li').parent('ul').find(':checkbox').attr('checked', this.checked); | |
}); | |
}); | |
// Just add a class "checkall" to your checkbox form item in Gravity Forms, it assumes the first item in the list will be the "All" option. |
This file contains hidden or 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
// Filter wp_nav_menu() to add additional links and other output | |
function new_nav_menu_items($items,$args) { | |
if ($args->theme_location == 'primary-menu') { | |
if (function_exists('icl_get_languages')) { | |
$languages = icl_get_languages('skip_missing=0'); | |
if(1 < count($languages)){ | |
foreach($languages as $l){ | |
if(!$l['active']){ | |
$items = $items.'<li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-00000"><a href="'.$l['url'].'">'.$l['language_code'].'</a></li>'; | |
} |
This file contains hidden or 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 | |
function portfolios_shortcode($atts){ | |
extract( shortcode_atts( array( | |
'expand' => '', | |
), $atts) ); | |
global $paged; | |
$posts_per_page = 6; | |
$settings = array( |
This file contains hidden or 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 | |
// SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY | |
$category = get_the_category(); | |
$useCatLink = true; | |
// If post has a category assigned. | |
if ($category){ | |
$category_display = ''; | |
$category_link = ''; | |
if ( class_exists('WPSEO_Primary_Term') ) |
This file contains hidden or 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 | |
function replace_swpm_login_form_shortcode_function(){ | |
global $wpdb; | |
$cur_prefix = $wpdb->prefix; | |
$current_user = wp_get_current_user(); | |
$user_login_get = $current_user->user_login; |