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 | |
/*Template Name: Taking Action */ | |
get_header(); | |
global $post; | |
$postID = $post->ID; | |
global $postID; | |
?> | |
<div class="wrap container"> | |
<div class="content-area row" > | |
<div class="col-md-8" id="content"> |
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 wpex_restrict_page_to_logged_in_user() { | |
// Get global post | |
global $post; | |
// Prevent access to page with ID of x and all children of this page | |
$page_id = 5631; | |
$parent = $post->post_parent; | |
$get_grandparent = get_post($parent); | |
$grandparent = $get_grandparent->post_parent; |
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
//custom excerpt | |
function get_post_excerpt($post_id,$elips, $length, $cta, $class){ | |
$the_post = get_post($post_id); //Gets post ID | |
$the_excerpt = $the_post->post_content; //Gets post_content to be used as a basis for the excerpt | |
$the_excerpt = $content = apply_filters('the_content', $the_excerpt); //keep formatting | |
$the_excerpt = str_replace('\]\]\>', ']]>', $the_excerpt); //keep formatting continued.. | |
$excerpt_length = $length; //Sets excerpt length by word count | |
$the_excerpt = strip_tags($the_excerpt, '<p>'); //Strips tags and images (except for <p> tags) | |
$words = explode(' ', $the_excerpt, $excerpt_length + 1); | |
if(count($words) > $excerpt_length) : |
NewerOlder