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 list_child_pages() { | |
global $post; | |
if ( is_page() && $post->post_parent ) | |
$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' ); | |
else | |
$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0' ); | |
if ( $childpages ) { | |
$string = '<ul>' . $childpages . '</ul>'; |
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
<div <?php post_class( get_the_ID() == get_queried_object_id() ? 'oxy-post current-post' : 'oxy-post'); ?>> | |
<a class='oxy-post-title' href='<?php the_permalink(); ?>'><?php the_title(); ?></a> | |
</div> |
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
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); | |
/** | |
* Change the length of excerpt. | |
* | |
* @param int $length The number of words. Default 55. | |
* @return int New excerpt length. | |
*/ | |
function custom_excerpt_length( $length ) { | |
return 20; // number of words. Default is 55. |
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 | |
$link = get_field('gmb_url'); | |
if( $link ): ?> | |
<iframe src="<?php echo esc_url( $link ); ?>" width="1200" height="900" frameborder="0" style="border:0;" allowfullscreen=""></iframe> | |
<?php endif; ?> |
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
.wp-grid-builder .wpgb-sidebar { | |
position: sticky; | |
flex-basis: 50%; | |
height: 100vh; | |
top: 0; | |
} | |
.wp-grid-builder .wpgb-main { | |
overflow: hidden; | |
padding: 3em 4em; | |
} |
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
/** | |
* Display a custom taxonomy dropdown in admin | |
* @author Mike Hemberger | |
* @link http://thestizmedia.com/custom-post-type-filter-admin-custom-taxonomy/ | |
*/ | |
add_action('restrict_manage_posts', 'tsm_filter_post_type_by_taxonomy'); | |
function tsm_filter_post_type_by_taxonomy() { | |
global $typenow; | |
$post_type = 'team'; // change to your post type | |
$taxonomy = 'group'; // change to your 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 Custom Code - plugins loaded | |
if ( function_exists( 'acf_add_options_page' ) ) { | |
acf_add_options_page(); | |
} | |
function tct_field($field_name) { | |
return get_field( $field_name, 'option' ); | |
} |
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 tct_set_new_date() { | |
$posts = get_posts( array('post_type' => 'session', 'posts_per_page' => - 1) ); | |
$current_date = date( "Y-m-d h:i" ); | |
foreach($posts as $post) { | |
$old_date = get_field( 'date', $post->ID ); | |
if($old_date < $current_date) { | |
$new_date = date( 'Y-m-d h:i', strtotime( '+1 week', strtotime( $old_date ) ) ); | |
update_field( 'date', $new_date, $post->ID ); |
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 check_query_field( $cpt_name, $acf_field ){ //Put CPT as function name | |
//WP_Query arguments | |
$args = array( | |
'post_type' => array( $cpt_name ),//CPT NAME Here | |
'meta_query' => array( | |
array( | |
'key' => $acf_field, //ACF FIELD NAME HERE | |
'value' => get_the_ID(), | |
'compare' => 'LIKE', |