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 | |
add_filter( 'template_include', 'ja_template_check' ); | |
function ja_template_check( $template ) { | |
if ( is_category() ){ | |
// Get category information | |
$cat = get_query_var( 'cat' ); | |
$category_info = get_category( $cat ); | |
// News sub-categories, where 7 is the ID for News |
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 | |
/** | |
* Disable multipage scroll | |
* | |
*/ | |
function wpf_disable_multipage_scroll() { | |
?> | |
<script type="text/javascript">window.wpforms_pageScroll = false;</script> | |
<?php | |
} |
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
function user_function_restrict_content( $atts, $content = null ) { | |
if ( is_user_logged_in() && !is_null($content) && !is_feed() ) { | |
return do_shortcode( $content ); | |
} else { | |
return 'Sorry, this content is only available for logged users.'; | |
} | |
} | |
add_shortcode( 'member', 'user_function_restrict_content' ); |
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 | |
/* | |
* If the current post is protected by a password and | |
* the visitor has not yet entered the password we will | |
* return early without loading the comments. | |
*/ | |
if ( post_password_required() ) { | |
return; | |
} | |
?> |
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 | |
/** | |
* Enqueue scripts and styles. | |
* | |
* @since 1.0.0 | |
*/ | |
function ja_global_enqueues() { | |
wp_enqueue_style( | |
'jquery-auto-complete', |
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 | |
/** | |
* Remove empty paragraph tags | |
* | |
* @since 1.0.0 | |
* @param string $content | |
* @return string | |
*/ | |
function ja_remove_empty_tags( $content ){ | |
// clean up p tags around block elements |
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 | |
/** | |
* Disable visual TinyMCE editor for specifc page/post | |
* | |
* @since 1.0.0 | |
*/ | |
function ja_disable_fancy_editor( $can ) { | |
global $post; | |
if ( 3441 == $post->ID ) { |
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 | |
/** | |
* Change "About" text in author box titles for single posts | |
* | |
* @since 1.0.0 | |
* @param string $title | |
* @param string $context | |
* @return string | |
*/ | |
function ja_author_box_title( $title, $context ) { |
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 | |
/** | |
* Disable feeds | |
* | |
* @return string die | |
*/ | |
function ja_disable_feed() { | |
wp_die( 'No feed available, please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!' ); | |
} |
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 | |
/** | |
* Add Custom Image Sizes to Media Uploader | |
* @author Pippin Williamson | |
* @link http://pippinsplugins.com/add-custom-image-sizes-to-media-uploader/ | |
* | |
* @param array $sizes | |
* @return array | |
*/ |