Skip to content

Instantly share code, notes, and snippets.

//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' );
}
/**
* 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
.wp-grid-builder .wpgb-sidebar {
position: sticky;
flex-basis: 50%;
height: 100vh;
top: 0;
}
.wp-grid-builder .wpgb-main {
overflow: hidden;
padding: 3em 4em;
}
<?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; ?>
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.
<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>
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>';
function my_acf_shortcode( $atts ){
$atts = shortcode_atts( array(
'field' => '',
'image' => ''
), $atts, 'showfield' );
if ( get_field( $atts['field'] ) && ( $atts['image'] !== '' ) ) :
return '<a href="' . get_field( $atts['field'] ) . '"><img src="' . $atts['image'] . '"></a>';
endif;
}
/*Image Overlay on Hover*/
.image-overlay{
position: relative;
cursor: pointer;
}
.text-colour a{
color:black;
}
.image-overlay:after {
content: "";