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_filter( 'wp_nav_menu_items', 'woo_custom_add_sociallink_navitems', 10, 2 ); | |
function woo_custom_add_sociallink_navitems ( $items, $args ) { | |
global $woo_options; | |
if ( $args->theme_location == 'primary-menu' ) { | |
$template_directory = get_template_directory_uri(); | |
$profiles = 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
if (function_exists('register_sidebar')) { | |
register_sidebar(array( | |
'name' => 'Header Widget', | |
'id' => 'header-widget', | |
'description' => 'This is a widgetized area in the right side of the header.', | |
'before_widget' => '<div id="%1$s" div class="widget">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3>', | |
'after_title' => '</h3>' | |
)); |
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_action( 'init', 'remove_canvas_main_navigation', 10 ); | |
function remove_canvas_main_navigation () { | |
// Remove main nav from the woo_header_after hook | |
remove_action( 'woo_header_after','woo_nav', 10 ); | |
} | |
add_action( 'init', 'remove_canvas_top_navigation', 10 ); | |
function remove_canvas_top_navigation () { |
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
// Start custom_add_related_posts() | |
add_action( 'woo_post_inside_after', 'custom_add_related_posts' ); | |
function custom_add_related_posts () { | |
if ( is_single() ) { | |
echo '<h3>You may also like to read:</h3></br>'; | |
echo do_shortcode('[related_posts limit="4" image="120"]'); | |
} | |
} // End woo_add_related_posts() |
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_action( 'woo_nav_inside', 'custom_nav_searchform', 10 ); | |
function custom_nav_searchform () { | |
echo '<div id="nav-search" class="nav-search fr">' . " | |
"; | |
get_template_part( 'search', 'form' ); | |
echo '</div><!--/#nav-search .nav-search fr-->' . " | |
"; | |
} | |
//OR |
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_action('template_redirect', 'redirect_single_post'); | |
function redirect_single_post() { | |
if (is_search()) { | |
global $wp_query; | |
if ($wp_query->post_count == 1 && $wp_query->max_num_pages == 1) { | |
wp_redirect( get_permalink( $wp_query->posts['0']->ID ) ); | |
exit; | |
} | |
} | |
} |
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
/* Remove Comment are Closed | |
.nocomments { | |
display: none; | |
}*/ | |
/* Change User Avatoar to Square | |
#post-author .profile-image img, #comments .avatar img { | |
border-radius: 0; | |
-moz-border-radius: 0; | |
-webkit-border-radius: 0; |
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 | |
//* Do NOT include the opening php tag http://www.rickrduncan.com/wordpress/customize-wordpress-widget-titles | |
//* Insert SPAN tag into widgettitle | |
add_filter( 'dynamic_sidebar_params', 'b3m_wrap_widget_titles', 20 ); | |
function b3m_wrap_widget_titles( array $params ) { | |
// $params will ordinarily be an array of 2 elements, we're only interested in the first element | |
$widget =& $params[0]; | |
$widget['before_title'] = '<h4 class="widgettitle"><span class="sidebar-title">'; |
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 taxonomy term of products category to body classes | |
function woo_custom_taxonomy_in_body_class( $classes ){ | |
if( is_singular( 'product' ) ) | |
{ | |
$custom_terms = get_the_terms(0, 'product_cat'); | |
if ($custom_terms) { | |
foreach ($custom_terms as $custom_term) { | |
$classes[] = 'product_cat_' . $custom_term->slug; | |
} | |
} |
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
//to exclude a field from notifications assign the field the CSS Class Name gf_exclude and then use the {all_fields:exclude} merge tag | |
add_filter( 'gform_merge_tag_filter', 'exclude_from_all_fields', 10, 4 ); | |
function exclude_from_all_fields( $value, $merge_tag, $options, $field ) { | |
$options_array = explode( ",", $options ); //breaks options into an array | |
$exclude = in_array( "exclude", $options_array ); //returns TRUE if 'exclude' is found in the array | |
$class_array = explode( " ", $field["cssClass"] ); //breaks the fields CSS classes into an array | |
$exclude_class = in_array( "gf_exclude", $class_array ); //returns TRUE if 'gf_exclude' is found in the array | |
if ( $merge_tag == "all_fields" && $exclude == true && $exclude_class == true ) | |
return false; |
OlderNewer