Requires Co-Authors Plus WordPress Plugin and ACF
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
//Auto add and update Title field: | |
function my_post_title_updater( $post_id ) { | |
$my_post = array(); | |
$my_post['ID'] = $post_id; | |
// custom post type | |
if ( get_post_type() == 'case_study' ) { | |
$my_post['post_title'] = get_field('case_study_title'); |
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 | |
$imgID = get_field('field_slug'); | |
$imgSize = "large"; // (thumbnail, medium, large, full or custom size) | |
$imgArr = wp_get_attachment_image_src( $imgID, $imgSize ); | |
// $url = $image[0]; | |
// width = $image[1]; | |
// height = $image[2]; |
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 // remove this tag | |
// ADD NEW COLUMN | |
function JOBDIVISION_columns_head($defaults) { | |
$defaults['division_post_obj'] = 'Division'; // Replace with your column name | |
return $defaults; | |
} | |
// SHOW THE TITLE |
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 | |
// GALLERY LAYOUTS - Flexible Content | |
// check if the flexible content field has rows of data | |
if( have_rows('galleries') ): | |
// loop through the rows of data | |
while ( have_rows('galleries') ) : the_row(); |
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
$('.article-body').on('wheel', function(e) { | |
var delta = e.originalEvent.deltaY; | |
if (delta > 0) | |
alert('down'); | |
else | |
alert('up'); | |
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($) { | |
/* | |
* render_map | |
* | |
* This function will render a Google Map onto the selected jQuery element | |
* | |
* @type function | |
* @date 8/11/2013 | |
* @since 4.3.0 |
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 //remove this | |
function my_query_args($query_args, $grid_name) { | |
if ($grid_name == 'Related Treatments') { | |
$treatments = get_field('related_treatments', get_the_ID(), false); | |
$query_args['post__in'] = $treatments; | |
} | |
return $query_args; | |
} |
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
location ~* \.(?:css|js|txt)$ { | |
expires 1y; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay off; | |
add_header Cache-Control "public"; | |
} | |
#Media: images, icons, video, audio, HTC | |
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { |
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 //remove this line | |
add_filter( 'wp_get_nav_menu_items', 'cpt_locations_filter', 10, 3 ); | |
function cpt_locations_filter( $items, $menu, $args ) { | |
$child_items = array(); | |
$menu_order = count($items); | |
$parent_item_id = 0; | |
foreach ( $items as $item ) { |