This file contains hidden or 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 facebook_javascript() { | |
| global $q_config; | |
| $fb_lang = 'de_DE'; | |
| switch ( $q_config['language'] ) { | |
| case 'en': $fb_lang = 'en_US'; break; | |
| case 'fr': $fb_lang = 'fr_FR'; break; | |
| case 'it': $fb_lang = 'it_IT'; break; | |
| case 'es': $fb_lang = 'es_ES'; break; | |
| } |
This file contains hidden or 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
| // loop through posts, populating $departments arrays | |
| foreach($posts as $post) { | |
| $deps = strip_tags( get_post_meta( $post->ID, '_cmb_department_text', TRUE )); | |
| preg_match_all("/,\s*/", $deps, $matches ); | |
| $result = array_combine($matches[1], $matches[2]); | |
| $departments[$result][] = $post; | |
| } |
This file contains hidden or 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
| http://www.benmarshall.me/wordpress-sql-queries/#image-paths |
This file contains hidden or 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 | |
| /* | |
| * Loop through Categories and Display Posts within | |
| */ | |
| $post_type = 'features'; | |
| // Get all the taxonomies for this post type | |
| $taxonomies = get_object_taxonomies( array( 'post_type' => $post_type ) ); | |
| foreach( $taxonomies as $taxonomy ) : |
This file contains hidden or 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 | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
| * Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
| */ | |
| $args = array( |
This file contains hidden or 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
| photos_query = new WP_Query( $photos ); | |
| $quotes_query = new WP_Query( $quotes ); | |
| $result = new WP_Query(); | |
| // start putting the contents in the new object | |
| $result->posts = array_merge( $photos_query->posts, $quotes_query->posts ); | |
| // here you might wanna apply some sort of sorting on $result->posts | |
| // we also need to set post count correctly so as to enable the looping |
This file contains hidden or 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 | |
| $term = get_term_by( 'slug', get_query_var( 'tag' ), "post_tag" ); | |
| $tagslug = $term->slug; | |
| $post_types = get_post_types('','names'); | |
| ?> | |
| <?php | |
| //first query | |
| $blogposts = get_posts(array( | |
| 'tag' => $tagslug, //first taxonomy | |
| 'post_type' => $post_types, |
This file contains hidden or 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 | |
| $posts_per_page = 3; // how many posts per term | |
| $taxonomy = 'category'; // taxonomy | |
| $post_type = 'post'; // post type | |
| $include_terms = array( 1, 25, 58 ); // the terms A B C ids | |
| $post_count = $i = 0; | |
| $custom_terms = get_terms( $taxonomy, array( 'parent' => 0, 'include' => $include_terms ) ); | |
| if ( $custom_terms ) : |
This file contains hidden or 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 add_menu_parent_class( $items ) { | |
| // GET PARENT ITEMS | |
| $parents = array(); | |
| foreach ( $items as $item ) { | |
| if ( $item->menu_item_parent && $item->menu_item_parent > 0 ) { | |
| $parents[] = $item->menu_item_parent; | |
| } | |
| } |
This file contains hidden or 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
| # Install linux update, followed by GCC and Make | |
| sudo yum -y update | |
| sudo yum install -y gcc make | |
| # Install Nginx and PHP-FPM | |
| sudo yum install -y nginx php-fpm | |
| # Install PHP extensions | |
| sudo yum install -y php-devel php-mysql php-pdo \ | |
| php-pear php-mbstring php-cli php-odbc \ |