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 | |
/** | |
* Add login/logout link to naviagation menu | |
* Typically this will go in functions.php. | |
*/ | |
function add_login_out_item_to_menu( $items, $args ){ | |
//change the theme_location menu name to match the location in your theme. | |
if( is_admin() || $args->theme_location != 'primary_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
<?php | |
/** | |
* Add your Google Fonts here. | |
* This is specifically for the theme Sage from roots.io and goes in config.php | |
* Change the font name, weights and styles to what you are using as needed. | |
*/ | |
define('GOOGLE_FONTS', 'Oswald:400,300,700:latin'); |
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 | |
/** | |
* Customize the standard WordPress Login page. | |
* Add to functions.php | |
*/ | |
//Link to custom style sheet to override default. | |
function my_login_stylesheet() { | |
wp_enqueue_style( 'custom-login', get_template_directory_uri() . '/dist/styles/main.css' ); | |
} |
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 | |
/** | |
* Customize URL for default registration on wp-login page. | |
* Add to functions.php | |
**/ | |
function wp_kompanee_register_url($link){ | |
//Change wp-login registration url | |
return str_replace(site_url('wp-login.php?action=register', 'login'),site_url('register', 'login'),$link); | |
} |
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 | |
/** | |
* Add support for SOLIDWORKS (.sldprt) file type to be uploaded in Media Library | |
* Add to functions.php | |
*/ | |
function solidworks_mime_types($mime_types){ | |
$mime_types['sldprt'] = 'application/octet-stream'; //Adding svg extension | |
return $mime_types; | |
} |
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 | |
/** | |
* Change the search page to return 25 posts per page in results. | |
* Add to functions.php | |
*/ | |
add_filter('post_limits', 'search_postsperpage'); | |
function search_postsperpage($limits) { | |
if (is_search()) { | |
global $wp_query; |
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 | |
/** | |
* Add A Shortcode allowing content for non-logged in users. | |
* Add to functions.php | |
* This could used in a situation where you have gated content and the user needs to be logged in to view. | |
* An example of usage is: [not_logged_in]You must be logged in to view this content[/not_logged_in] | |
*/ | |
function check_user ($params, $content = null){ | |
//if the user is not logged in. You can remove the ! if you want to change the statement to is logged in. |
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
// Allow bootstrap menu items to be linked and show on hover. | |
$('#primary-navigation .dropdown-toggle').click(function() { | |
var location = $(this).attr('href'); | |
window.location.href = location; | |
return false; | |
}); | |
//Add Fade Amination on Hover | |
$('#primary-navigation ul.nav li.dropdown').hover(function() { | |
$(this).find('.dropdown-menu').stop(true, true).delay(50).fadeIn(200); | |
}, function() { |