Intended as a quick reference/snipppet for WP pagination.
- Go to the Reading tab.
2)Change the Blog pages show at most from the default 10 to any number *less than 10.
@light-blue : #02a0df; | |
@black : #000; | |
.button( @color: @light-blue ) { .btn; border-radius: 0px; background-color: @color; color: #FFF; font-size: 16px; font-weight: bold; line-height: 28px; letter-spacing: .02em; text-transform: uppercase; padding: 6px 61px; .transition(background-color .4s ease); | |
&:hover, &:active, &:focus { background-color: darken(@light-blue, 10%); color: white; } | |
} | |
/* | |
* Labels and input on the same line with inline checkboxes and radios |
<?php | |
$category_id = htmlspecialchars($_GET['cat']); | |
if( !empty($category_id) ){ | |
$args = array( | |
'posts_per_page' => -1, | |
'post_type' => 'testimonials', | |
'orderby' => 'menu_order', | |
'order' => 'ASC', | |
'post_status' => 'publish', | |
'tax_query' => array( |
/* Container used for styling the custom select, the buttom class below adds the | |
* bg gradient, corners, etc. */ | |
.custom-select { | |
position: relative; | |
display: block; | |
select { | |
width: 100%; | |
margin: 0; | |
height: 50px; | |
border: 1px solid #CCC; |
The reset for bootstrap, so I don't have to keep recreating it every single time.
Put this helper function your functions.php file and pass in an argument (or don't). This way you're alt attribute is always filled out for every image on your site.
This checks to see if the alt attribute is assigned in the WordPress media library and returns that or it just returns the name of the site.
Tip: Use Advanced Custom Fields for the alt attribute.
add_action('save_post', 'pk_require_post_thumbnail'); | |
add_action('admin_notices', 'pk_post_thumbnail_error'); | |
function pk_require_post_thumbnail($post_id) { | |
// change to any custom post type | |
if(get_post_type($post_id) != 'post') | |
return; | |
if ( !has_post_thumbnail( $post_id ) ) { |
//Enqueue JS like we normally do. | |
function add_test_js_files(){ | |
wp_enqueue_script('script1', '//script1.js?cid=6asdfsdf'); | |
wp_enqueue_script('script2', '//script2.js?cid=a213423423'); | |
} | |
add_action('wp_enqueue_scripts','add_test_js_files'); | |
function add_async_attribute($tag, $handle) { |