Skip to content

Instantly share code, notes, and snippets.

View barbwiredmedia's full-sized avatar

Barbara Talbot barbwiredmedia

View GitHub Profile
@barbwiredmedia
barbwiredmedia / file.html
Created July 7, 2014 18:01
Pure CSS line mask create a pure CSS line border bottom that does not span the full width of the space. (KW: half line, short)
<div class="line"></div>
@barbwiredmedia
barbwiredmedia / font-list-icons.css
Last active August 29, 2015 14:03
Using icon fonts for lists. font icons, fontawesome, list replacement
/*Icon Fonts for List replacements*/
.fa-ul {
padding-left: 0;
margin-left: 2.142857142857143em;
list-style-type: none;
}
.fa-ul > li {
position: relative;
}
.fa {
@barbwiredmedia
barbwiredmedia / functions.php
Created July 15, 2014 20:43
Removes Wordpress menus items for users from the dashboard. wordpress functions.php
function remove_menus () {
global $menu;
$restricted = array(__('Dashboard'), __('Posts'), __('Media'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins'));
end ($menu);
while (prev($menu)){
$value = explode(' ',$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
}
}
add_action('admin_menu', 'remove_menus');
@barbwiredmedia
barbwiredmedia / add-menu
Last active August 29, 2015 14:05
Wordpress register menu functions.php navigation
//Multiplemenus - https://codex.wordpress.org/Function_Reference/register_nav_menus
register_nav_menus( array(
'footer-nav-1' =>'Footer Navigation One',
'footer-nav-2' => 'Footer Navigation Two',
'footer-nav-3' => 'Footer Navigation Three',
) );
// Creates custom menus Pre 3.0 (single with array added: https://codex.wordpress.org/Function_Reference/register_nav_menu)
@barbwiredmedia
barbwiredmedia / redirect-rules
Created August 11, 2014 21:28
WPengine Redirect rules: Roots theme rewrite rules for theme to work correctly (.htaccess does not work because of nginx)
URL Redirect Assets:
All Domains
^/assets/(img|js|css|fonts)/(.*)$
/wp-content/themes/theme-name/assets/$1/$2
break
URL Redirect Plugins:
All Domains
^/plugins/(.*)$
/wp-content/plugins/$1
@barbwiredmedia
barbwiredmedia / style.scss
Last active August 29, 2015 14:05
Wordpress: Tubepress shortcode YouTube options for in WYSIWYG Playlist mode. (KW: shadowbox) http://docs.tubepress.com/en/latest/reference/options/youtube.html
//Make ShadowBox responsive
.tubepress_container, .youtube-player {
position: relative; overflow: hidden; max-width: 100%; height: 100%;}
@barbwiredmedia
barbwiredmedia / childpage.php
Last active August 29, 2015 14:07
Wordpress Conditional bases on children or child pages
<?php
$children = get_pages('child_of=' . $post->ID);
if (count($children) != 0) {
?>
DO something
<?php } else { ?>
DO else
<?php } ?>
@barbwiredmedia
barbwiredmedia / post_thumbnail.php
Last active August 29, 2015 14:08
Wordpress get_post_thumbnail and size. Attachement Image
<?php
$yourImageThumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'image-thumb-size'); //get attached post thumbnail and resize
if ( '' != get_the_post_thumbnail() ) {
?>
<img src="<?php echo $yourImageThumb[0]; ?>" class="img-responsive" alt="<?php echo $post->post_title; ?>">
<?php } else {?>
<img src="http://placehold.it/260x195&text=default" class="img-responsive">
<?php } ?>
@barbwiredmedia
barbwiredmedia / clickable-panel.scss
Created December 16, 2014 22:55
Semantic Clickable panel without the use of javascript.
.click-panel {
position:relative;
.default-link {
position:absolute;
width:100%;
height:100%;
top:0;
left: 0;
z-index: 1;
}
@barbwiredmedia
barbwiredmedia / include.php
Created December 19, 2014 18:07
Wordpress php include template path
<?php include(TEMPLATEPATH . '/your/file/path.php'); ?>