Skip to content

Instantly share code, notes, and snippets.

View jessijean's full-sized avatar
📚
Study Time

Jessica Jean Bujazia jessijean

📚
Study Time
View GitHub Profile
global $paged;
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query( array( 'meta_key' => 'wpcf-gender', 'meta_value' => '1', 'meta_compare' => '==', 'post_type' => 'profile','posts_per_page' => 2, 'paged' => $paged ) );
/**
* Gets a single value.
* The first value if field group is repeatable
*
* @param string $field_slug
* @param int $post_id ID of post or null to use current post in loop
* @param array $options Array or query string of options to send to field type
* @return mixed string or array, depending on the field type
*/
function simple_fields_value($field_slug = NULL, $post_id = NULL, $options = NULL) {
/* Style comments made by the post author */
li.bypostauthor {
background:#fafafa;
color:#555;
}
//add specific custom post types to your rss feed
add_filter('request', 'smashing_custom_feed');
$post_type_list = array( 'post', 'products' );
function smashing_custom_feed( $vars ) {
if ( isset( $vars['feed'] ) AND !isset( $vars['post_type'] ) ) {
$vars['post_type'] = $post_type_list;
}
return $vars;
//add custom post types to the rss feed in wordpress
add_filter('request', 'smashing_custom_feed');
function smashing_custom_feed( $vars ) {
if ( isset( $vars['feed'] ) ) {
$vars['post_type'] = get_post_types();
}
return $vars;
}
$my_url = 'http://mypage.com/?awesome=true';
$url = esc_url( $my_url );
add_filter( 'jpeg_quality', 'smashing_jpeg_quality' );
function smashing_jpeg_quality() {
return 100;
}
/*========================================= ACF Repeater ======================================== */
add_action( 'woo_post_inside_after', 're_acf_repeater', 10); // hook is the first part   function re_acf_repeater () { ?> <?php if(get_field('field_name')): ?> <ul> <?php while(has_sub_field('field_name')) { ?> <li><?php the_sub_field('sub_field_name'); ?></li> <?php } ?> </ul> <?php endif; ?> <?php }
@jessijean
jessijean / css_resources.md
Created October 22, 2013 19:04 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@jessijean
jessijean / javascript_resources.md
Created October 22, 2013 19:03 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage