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 $args = array( | |
'post_type' => 'post_type', | |
'showposts' => 200, | |
'orderby' => 'menu_order', | |
'order' => 'ASC' | |
); | |
$customquery = new WP_Query( $args ); ?> | |
<?php |
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 | |
$args = array( | |
'post_type' => 'post_type', | |
'post_status' => 'publish', | |
'ignore_sticky_posts' => 1, | |
'posts_per_page' => 24, | |
'orderby' => 'date', | |
'order' => 'desc', | |
); |
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 | |
$thumbnail_id = get_post_thumbnail_id( get_the_ID() ); | |
$img_url = wp_get_attachment_url( $thumbnail_id ); | |
if ( ! empty( $thumbnail_id ) ) { | |
echo wp_get_attachment_image( $thumbnail_id, 'thumbnail' ); | |
} else { | |
echo '<img src="http://placehold.it/300x300" />'; | |
} | |
?> |
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
/** | |
* Change your product per page | |
* @author alispx | |
*/ | |
add_filter( 'loop_shop_per_page', 'woo_shop_per_page' ); | |
function woo_shop_per_page() { | |
return 12; | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<link rel='stylesheet' id='style' href='http://local.wordpress.dev/alispx/wp-content/themes/highwind/style.css?ver=1.0' type='text/css' media='all' /> | |
<script type='text/javascript' src='http://local.wordpress.dev/alispx/wp-includes/js/jquery/jquery.js?ver=1.11.1'></script> |
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
function _remove_script_version( $src ){ | |
$parts = explode( '?', $src ); | |
return $parts[0]; | |
} | |
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 ); | |
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 ); |
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 | |
/* | |
Template Name: Update Network | |
*/ | |
get_header(); | |
if ( is_user_logged_in() ) { |
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
<? | |
/** | |
* Repeatable Custom Fields in a Metabox | |
* Author: Helen Hou-Sandi | |
* | |
* From a bespoke system, so currently not modular - will fix soon | |
* Note that this particular metadata is saved as one multidimensional array (serialized) | |
*/ | |
function hhs_get_sample_options() { |
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
// Design Bar | |
$this->design_bar( | |
'side', // CSS Class Name | |
array( | |
'name' => $this->get_field_name( 'design' ), | |
'id' => $this->get_field_id( 'design' ), | |
), // Widget Object | |
$instance, // Widget Values | |
array( | |
'layout', |
OlderNewer