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( 'template_redirect', 'so16179138_template_redirect', 0 ); | |
| function so16179138_template_redirect() | |
| { | |
| if( is_singular() ) | |
| { | |
| global $post, $page; | |
| $num_pages = substr_count( $post->post_content, '<!--nextpage-->' ) + 1; | |
| if( $page > $num_pages ){ | |
| include( get_template_directory() . '/404.php' ); | |
| exit; |
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 set_max_height(elms, addh) { | |
| if (typeof(addh) === 'undefined') addh = 0; | |
| var maxHeight = Math.max.apply(null, elms.map(function (){ | |
| return jQuery(this).height(); | |
| }).get()); | |
| elms.height(maxHeight+addh); | |
| } |
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
| require_once( ABSPATH . 'wp-admin/includes/image.php' ); | |
| $img_id = get_post_thumbnail_id( $service->ID ); | |
| $parsed = parse_url( wp_get_attachment_url( $img_id ) ); | |
| $url = ABSPATH . dirname( $parsed [ 'path' ] ) . '/' . rawurlencode( basename( $parsed[ 'path' ] ) ); | |
| $url = str_replace('/', '/', $url); | |
| $attach_data = wp_generate_attachment_metadata( $img_id, $url ); | |
| wp_update_attachment_metadata( $img_id, $attach_data ); |
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
| Snippet: [[SnippetName]] | |
| Chunk: [[$ChunkName]] | |
| System Setting: [[++SettingName]] | |
| TV: [[*fieldName/TvName]] | |
| Link tag: [[~PageId? ¶mName=`value`]] | |
| Placeholder: [[+PlaceholderName]] | |
| <?php |
OlderNewer