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
/* | |
* A basic dropdown set of styles for WP wp_nav_menu() / wp_pages_list() | |
* This dropin group of rulesets uses a top level selector nav#site-main which needs to be changed to suit or added to markup. | |
* There is a simple series of CSS Transitions to provide a little smoothness to the opening / closing of the menu and opacity * transitioned on the li elements. | |
* There are background colours added and obviously these are subjective and won't suit all themes so need changing | |
* There is a comlimentary JS snippet that just adds classes to hovered li elements and their parents, this is named in time * honoured manner as 'sfhover' it's real purpose used to be to provide support for IE but are also useful to provide xpath * navigation back up the li nodes and used here to add li backgrounds on all hovered elements parents. In addition the script * Adds a class 'has-child' to li elements having nested ul li children. | |
*/ | |
/* Configure main menu dropdowns */ | |
nav#site-main ul li { |
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 BP username via a shortcode function | |
* Use in pages or posts? | |
* For no real reason one can pass a specific user id through | |
*/ | |
function display_username_in_posts($atts) { | |
$bp = buddypress(); | |
extract(shortcode_atts(array( | |
"id" => '', | |
), $atts)); |
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
/* | |
* Shortcode get_post loop | |
* | |
* Shortcode displays loops for categories in posts or pages. | |
* It takes params for cat ID, qnt, show_thumbs, show_excerpt & height / width. | |
* | |
* [hnla_cat_loop cat_id='4' qnt='4' show_thumb=true show_excerpt=true, height='120', width='120' ] | |
* | |
* If showing thumbnails additional markup elements wrap the title and excerpt to allow positioning to right side of | |
* floated thumbnail. |
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 BP user account links via a shortcode | |
* For use in pages or posts or widgets if enabled for shortcode parsing? | |
* Shortcode example: [hnla_bpuser_links where_to='activity/mentions' link_text='the text for link' title_attr='visit your @mentions' display_name='yes'] | |
* The display name is optional leave out for no display, name will simply display in a span element before anchor link | |
* | |
* @author Hugo - hnla | |
* @version 1.0 | |
* @licence GNU General Public License, version 2 | |
*/ |
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_action('widgets_init', create_function('', 'return register_widget("HNLA_loggin_Widget");') ); | |
class HNLA_loggin_Widget extends WP_Widget { | |
function __construct() { | |
parent::__construct( | |
'HNLA_loggin_Widget', | |
'BP Login, Logout form', | |
array( 'description' => __('Displays the standard BP login form and logged in avatar, logout link', 'hnla'), ) | |
); |
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_action('widgets_init', create_function('', 'return register_widget("HNLA_bp_sitewide_messages_Widget");') ); | |
class HNLA_bp_sitewide_messages_Widget extends WP_Widget { | |
function __construct() { | |
parent::__construct( | |
'HNLA_bp_sitewide_messages_Widget', //the ID? | |
'HNLA BP Sitewide Messages', //the widget name | |
array( 'description' => __('Displays the BP admin \'all users\' sitewide messages', 'meson'), ) | |
); |
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
// Cache busting dynamically | |
function get_file_last_mod($filename) { | |
$filename = dirname(__FILE__) . '/assets/css/' . $filename; | |
if( file_exists($filename) ){ | |
$version = date ("M d Y H:i:s.", filemtime($filename)); | |
}else{ | |
// manual cache busting | |
$version = 'V1.0'; | |
} | |
return $version; |