This file contains 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 role="search" method="post" class="search-form padding-4" action="<?php echo home_url( '/' ); ?>"> | |
<label> | |
<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ) ?></span> | |
<input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search...', 'placeholder' ) ?>" value="<?php echo get_search_query() ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" /> | |
<input class="post_type" type="hidden" name="post_type" value="frequent" /> | |
</label> | |
<input type="submit" class="search-submit button brand" id="searchsubmit" value="<?php echo esc_attr_x( 'Search', 'submit button' ) ?>" /> | |
</form> | |
<script type="text/javascript"> |
This file contains 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 | |
//redirect based on custom field value | |
add_filter( 'post_link', 'catalyst_external_permalink', 10, 2 ); | |
function catalyst_external_permalink( $link, $post ){ | |
$meta = get_post_meta( $post->ID, 'external_url', TRUE ); | |
$url = esc_url( filter_var( $meta, FILTER_VALIDATE_URL ) ); | |
return $url ? $url : $link; | |
} |
This file contains 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
# Protect WP Media Files | |
# https://m0n.co/protect-media-files | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} /wp-content/uploads/ [NC] | |
RewriteCond %{HTTP_REFERER} !^https://example.com [NC] | |
RewriteRule .* - [F,L] | |
</IfModule> |
This file contains 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
$start_date = date( 'ym01' ); | |
$end_date = date( 'ymt' ); | |
$meta_query = array( | |
'key' => 'event_date', | |
'value' => array( $start_date, $end_date ), | |
'compare' => 'BETWEEN', | |
'type' => 'NUMERIC' | |
); | |
$args = array( | |
'post_type' => 'hh_event', |
This file contains 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 | |
is_home() //Checks if the blog post index is being displayed. This may or may not be your home page as well. | |
is_front_page() //Checks if your home page is being displayed. This works whether your front page settings are set up to display blog posts (i.e. blog index) or a static page. | |
is_single() //Checks to see whether any type of single post is being displayed (excluding attachments). | |
is_attachment() //Checks if an attachment is displayed. |
This file contains 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
<IfModule mod_deflate.c> | |
# Compress all output labeled with one of the following MIME-types | |
# (for Apache versions below 2.3.7, you don't need to enable `mod_filter` | |
# and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines | |
# as `AddOutputFilterByType` is still in the core directives). | |
<IfModule mod_filter.c> | |
AddOutputFilterByType DEFLATE application/atom+xml \ | |
application/javascript \ | |
application/json \ |
This file contains 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
//create a new role | |
function psp_add_project_management_role() { | |
add_role('psp_project_manager', | |
'Project Manager', | |
array( | |
'read' => true, | |
'edit_posts' => false, | |
'delete_posts' => false, | |
'publish_posts' => false, |
NewerOlder