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
//This JavaScript code can be added into Divi using the integration option at: > Theme Options > Integration >"Add code to the < head > of your blog", and as a result will survive theme updates. | |
<script> | |
document.addEventListener('DOMContentLoaded', function(event){ | |
if (window.location.hash) { | |
// Start at top of page | |
window.scrollTo(0, 0); | |
// Prevent default scroll to anchor by hiding the target element |
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
<form method="get" role="search" action="https://example.com/" title="Type and press Enter to search."> | |
<input type="search" class="fl-search-input form-control" name="s" value="Search" onfocus="if (this.value == 'Search') { this.value = ''; }" onblur="if (this.value == '') this.value='Search';"> | |
<input type="hidden" name="post_type" value="post"></form> |
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 | |
$date = get_field('last_updated_or_reviewed', false, false); | |
$date = new DateTime($date); | |
; ?> | |
<p><strong>Briefsheet Updated on:</strong> <?php echo $date->format('F j, Y'); ?></p> |
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 if (isset($content['field_cube'])): ?> | |
<div class="c-field"><?php print render($content['field_cube']); ?><span class="tail-label"><?php print t('cubic feet');?></span></div> | |
<?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
<?php $terms = get_the_terms( $post->ID , 'taxonomyname' ); | |
foreach ( $terms as $term ) { | |
$term_link = get_term_link( $term, 'taxonomyname' ); | |
if( is_wp_error( $term_link ) ) | |
continue; | |
echo '<a href="' . $term_link . '">' . $term->name . '</a>'; | |
} | |
?> |
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 | |
global $wp_query; | |
$total_results = $wp_query->found_posts; | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
?> | |
Found <?php echo $total_results ;?> Results | |
Page <?php echo $paged; ?> of <?php echo $wp_query->max_num_pages; ?><br /> |
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 searchfilter($query) { | |
if ($query->is_search && !is_admin() ) { | |
$query->set('post_type',array('post','page')); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','searchfilter'); |
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_action("load-post-new.php", 'block_post'); | |
function block_post() | |
{ | |
if($_GET["post_type"] == "physician" || "posts" ) | |
wp_redirect("edit.php?post_type=physician"); | |
} |