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
img#fullscreen-bg { | |
width: 100%; | |
min-width: 1024px; | |
height: auto; | |
position: fixed; | |
top: 0; | |
left: 0; | |
z-index: -999; | |
} |
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
jQuery(document).ready(function() { | |
var page = jQuery('.single.post'); | |
var sidebar = jQuery('.single.post .scrolling-sidebar'); | |
var content = jQuery('.single.post .content'); | |
// Scroll with screen | |
var top = sidebar.offset().top; | |
var limit = top + page.height() - sidebar.height(); | |
// Define sidebar-wrapper height |
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
<?php | |
function custom_excerpt($new_length = 20, $new_more = '...') { | |
add_filter('excerpt_length', function () use ($new_length) { | |
return $new_length; | |
}, 999); | |
add_filter('excerpt_more', function () use ($new_more) { | |
return $new_more; | |
}); |
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
<?php | |
// Remove admin's menu options | |
add_action('admin_menu', 'remove_menu_options'); | |
function remove_menu_options () { | |
global $menu; | |
$remove = array(__('Links'), __('Posts'), __('Comments'), /*__('Dashboard'),*/ __('Tools'), /*__('Appearance'),*/ __('Plugins'), __('Users'), __('Settings')); | |
end($menu); |
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
<?php | |
// Return post's slug | |
function the_slug($echo=true) { | |
$slug = basename(get_permalink()); | |
do_action('before_slug', $slug); | |
$slug = apply_filters('slug_filter', $slug); | |
if( $echo ) echo $slug; | |
do_action('after_slug', $slug); | |
return $slug; |
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
<?php | |
/* -------------------- LOCALIZATION -------------------- */ | |
// PHP INI charset | |
ini_set("default_charset", "UTF-8"); | |
// Default timezone | |
date_default_timezone_set('America/Sao_Paulo'); |
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
The correct minimum set of headers that works across all mentioned browsers: | |
Cache-Control: no-cache, no-store, must-revalidate | |
Pragma: no-cache | |
Expires: 0 | |
Using PHP: | |
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1. | |
header('Pragma: no-cache'); // HTTP 1.0. |
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
// Scroll to top | |
jQuery(window).scroll(function() { | |
if( jQuery(this).scrollTop() != 0 ) { | |
jQuery('.scroll-to-top').fadeIn(); | |
} else { | |
jQuery('.scroll-to-top').fadeOut(); | |
} | |
}); |
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
<?php | |
//hook into the init action and call create_book_taxonomies when it fires | |
add_action( 'init', 'create_book_taxonomies', 0 ); | |
//create two taxonomies, genres and writers for the post type "book" | |
function create_book_taxonomies() | |
{ | |
// Add new taxonomy, make it hierarchical (like categories) | |
$labels = array( | |
'name' => _x( 'Genres', 'taxonomy general name' ), |
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
<?php | |
// Show post's attachment images | |
function show_attachment_images() { | |
$attachments = get_posts( array( | |
'post_type' => 'attachment', | |
'posts_per_page' => -1, | |
'post_parent' => 42, | |
'exclude' => get_post_thumbnail_id() | |
) ); | |
OlderNewer