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_filter( | |
'get_the_excerpt', | |
function ($excerpt) { | |
// Split the except into sentances | |
$re = '/(?<=[.!?]|[.!?][\'"])\s+/'; | |
$sentences = preg_split($re, $excerpt, -1, PREG_SPLIT_NO_EMPTY); | |
return $sentences[0]; | |
} | |
); |
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 Pagination. | |
function foundationpress_pagination() { | |
global $wp_query; | |
$big = 999999999; // This needs to be an unlikely integer | |
// For more options and info view the docs for paginate_links() | |
// http://codex.wordpress.org/Function_Reference/paginate_links | |
$paginate_links = paginate_links( array( | |
'base' => str_replace( $big, '%#%', html_entity_decode( get_pagenum_link( $big ) ) ), |
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
// Hook the post entry meta | |
function foundationpress_entry_meta() { | |
echo '<time class="updated" datetime="' . get_the_time( 'c' ) . '">' . sprintf( __( '%s', 'foundationpress' ), get_the_date() ) . '</time>'; | |
} |
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 ccc_latest_post($atts, $content=null){ | |
echo '<ul>'; | |
$myposts = get_posts( array('posts_per_page' => 3, 'category_name' => 'news') ); | |
foreach ( $myposts as $post ) : setup_postdata( $post ); ?> | |
<li> | |
<h4><a href="<?php echo get_the_permalink($post->ID); ?>"><?php echo get_the_title($post->ID); ?></a></h4> | |
<p><?php echo get_the_excerpt($post->ID); ?> <a href="<?php echo get_the_permalink($post->ID); ?>"><em>Read more...</em></a></p> | |
</li> | |
<?php endforeach; | |
wp_reset_postdata(); |
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 Breadcrumbs | |
// | |
function ccc_breadbrumbs() { | |
if ( !(is_home() || is_front_page()) ) { | |
echo '<div class="row"><div class="small-12 columns">'; | |
// Call the standard FP breadcrumb | |
foundationpress_breadcrumb(); | |
echo '</div></div>'; | |
} |
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 categories for attachments | |
// | |
function add_categories_for_attachments() { | |
register_taxonomy_for_object_type( 'category', 'attachment' ); | |
} | |
add_action( 'init' , 'add_categories_for_attachments' ); // add tags for attachments function | |
function add_tags_for_attachments() { | |
register_taxonomy_for_object_type( 'post_tag', 'attachment' ); | |
} |
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
// | |
// Auto hide the WP toolbar for users | |
// | |
add_filter('show_admin_bar', '__return_false'); |
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
# Block access to wp-admin. | |
order deny,allow | |
# Allow one IP address | |
allow from z.z.z.z | |
# Allow from a range of IP addresses | |
allow from x.x.x.x/24 | |
allow from y.y.y.y/27 |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
#RewriteCond %{SERVER_PORT} 80 | |
#RewriteRule ^(.*)$ https://domain.com/$1 [R,L] | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f |
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
<!DOCTYPE html> | |
<html> | |
<title>Web Site Closed</title> | |
<meta charset="UTF-8"> | |
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway"> | |
<style> | |
body,h1 {font-family: "Raleway", sans-serif} | |
body, html { height: 100%; color: #ffffff; background-color: #191919; text-align: center; overflow:visible; } |
OlderNewer