Permalink
Browse files

Removed Global from header, rationalised text domain

  • Loading branch information...
djm56 committed Sep 23, 2016
1 parent 9ae196f commit a60ddaa329a7034420e71e4d264c74533e9a6767
View
@@ -8,7 +8,7 @@
*
* Last Revised: Jul 15, 2016
*/
-global $childDir;
+
get_header(); ?>
<?php if (have_posts() ) ; ?>
<div class="container">
View
@@ -32,7 +32,7 @@
<?php
elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
- <p class="nocomments"><?php _e( 'Comments are closed.', 'purecsspress' ); ?></p>
+ <p class="nocomments"><?php _e( 'Comments are closed.', 'bootpresswp' ); ?></p>
<?php endif; ?>
<div class="pagination">
<?php paginate_comments_links(); ?>
View
@@ -79,8 +79,7 @@ function bootstrapwp_theme_features() {
require_once('includes/wp_bootstrap_pagination.php');
// Bootstrap breadcrumbs
require_once('includes/wp_bootstrap_breadcrumbs.php');
-// Add Shortcodes
-require_once('includes/wp_bootstrap_shortcodes.php');
+
function custom_bootpresswp_loader() {
@@ -131,8 +130,8 @@ function bootpresswp_widgets_init() {
function bootpresswp_menus() {
$locations = array(
- 'main-menu' => __( 'Main Header Menu', 'text_domain' ),
- 'footer-menu' => __( 'Footer Menu', 'text_domain' ),
+ 'main-menu' => __( 'Main Header Menu', 'bootpresswp' ),
+ 'footer-menu' => __( 'Footer Menu', 'bootpresswp' ),
);
register_nav_menus( $locations );
@@ -152,17 +151,17 @@ function bootpresswp_content_nav( $nav_id ) {
<?php if ( is_single() ) : // navigation links for single posts ?>
<ul class="pager" itemscope itemtype="http://schema.org/SiteNavigationElement/Pagination">
- <?php previous_post_link( '<li class="previous">%link</li>', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'purecsspress' ) . '</span> %title' ); ?>
- <?php next_post_link( '<li class="next">%link</li>', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'purecsspress' ) . '</span>' ); ?>
+ <?php previous_post_link( '<li class="previous">%link</li>', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'bootpresswp' ) . '</span> %title' ); ?>
+ <?php next_post_link( '<li class="next">%link</li>', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'bootpresswp' ) . '</span>' ); ?>
</ul>
<?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?>
<ul class="pager" itemscope itemtype="http://schema.org/SiteNavigationElement/Pagination">
<?php if ( get_next_posts_link() ) : ?>
- <li class="next"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'purecsspress' ) ); ?></li>
+ <li class="next"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'bootpresswp' ) ); ?></li>
<?php endif; ?>
<?php if ( get_previous_posts_link() ) : ?>
- <li class="previous"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'purecsspress' ) ); ?></li>
+ <li class="previous"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'bootpresswp' ) ); ?></li>
<?php endif; ?>
</ul>
<?php endif; ?>
@@ -181,11 +180,11 @@ function bootpresswp_comment_form_fields( $fields ) {
$html5 = current_theme_supports( 'html5', 'comment-form' ) ? 1 : 0;
$fields = array(
- 'author' => '<div class="form-group comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
+ 'author' => '<div class="form-group comment-form-author">' . '<label for="author">' . __( 'Name', 'bootpresswp' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
'<input class="form-control" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></div>',
- 'email' => '<div class="form-group comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
+ 'email' => '<div class="form-group comment-form-email"><label for="email">' . __( 'Email', 'bootpresswp' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
'<input class="form-control" id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></div>',
- 'url' => '<div class="form-group comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
+ 'url' => '<div class="form-group comment-form-url"><label for="url">' . __( 'Website', 'bootpresswp' ) . '</label> ' .
'<input class="form-control" id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></div>'
);
@@ -195,7 +194,7 @@ function bootpresswp_comment_form_fields( $fields ) {
add_filter( 'comment_form_defaults', 'bootpresswp_comment_form' );
function bootpresswp_comment_form( $args ) {
$args['comment_field'] = '<div class="form-group comment-form-comment">
- <label for="comment">' . _x( 'Comment', 'noun' ) . '</label>
+ <label for="comment">' . _x( 'Comment', 'noun','bootpresswp' ) . '</label>
<textarea class="form-control" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>
</div>';
$args['class_submit'] = 'btn btn-default'; // since WP 4.1
@@ -205,20 +204,20 @@ function bootpresswp_comment_form( $args ) {
add_action('comment_form', 'bootpresswp_comment_button' );
function bootpresswp_comment_button() {
- echo '<button class="btn btn-default" type="submit">' . __( 'Submit' ) . '</button>';
+ echo '<button class="btn btn-default" type="submit">' . __( 'Submit', 'bootpresswp' ) . '</button>';
}
if ( ! function_exists( 'bootpresswp_posted_on' ) ) :
function bootpresswp_posted_on() {
- printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="byline"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'bootstrap' ),
+ printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="byline"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'bootpresswp' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
- esc_attr( sprintf( __( 'View all posts by %s', 'bootstrap' ), get_the_author() ) ),
+ esc_attr( sprintf( __( 'View all posts by %s', 'bootpresswp' ), get_the_author() ) ),
esc_html( get_the_author() )
);
}
@@ -242,7 +241,7 @@ function bootstrapwp_comment( $comment, $args, $depth ) {
case 'trackback' :
?>
<li class="post pingback">
- <p><?php _e( 'Pingback:', 'bootstrap' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'bootstrap' ), ' ' ); ?></p>
+ <p><?php _e( 'Pingback:', 'bootpresswp' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'bootpresswp' ), ' ' ); ?></p>
<?php
break;
default :
@@ -252,19 +251,19 @@ function bootstrapwp_comment( $comment, $args, $depth ) {
<footer>
<div class="comment-author vcard">
<?php echo get_avatar( $comment, 40 ); ?>
- <?php printf( __( '<span itemprop="name">%s</span> <span class="says">says:</span>', 'bootstrap' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
+ <?php printf( __( '<span itemprop="name">%s</span> <span class="says">says:</span>', 'bootpresswp' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
</div>
<?php if ( $comment->comment_approved == '0' ) : ?>
- <em><?php _e( 'Your comment is awaiting moderation.', 'bootstrap' ); ?></em>
+ <em><?php _e( 'Your comment is awaiting moderation.', 'bootpresswp' ); ?></em>
<br />
<?php endif; ?>
<div class="comment-meta commentmetadata">
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><time pubdate datetime="<?php comment_time( 'c' ); ?>" itemprop="dateCreated">
<?php
/* translators: 1: date, 2: time */
- printf( __( '%1$s at %2$s', 'bootstrap' ), get_comment_date(), get_comment_time() ); ?>
+ printf( __( '%1$s at %2$s', 'bootpresswp' ), get_comment_date(), get_comment_time() ); ?>
</time></a>
- <?php edit_comment_link( __( '(Edit)', 'bootstrap' ), ' ' );
+ <?php edit_comment_link( __( '(Edit)', 'bootpresswp' ), ' ' );
?>
</div>
</footer>
View
@@ -8,8 +8,6 @@
*
* Last Revised: Aug 26, 2016
*/
-global $childDir;
-$childDir = dirname(get_bloginfo('stylesheet_url'));
?><!DOCTYPE html>
<!-- Bootpresswp -->
<!-- http://bootpresswp.anomalous.co.za -->
@@ -24,8 +22,8 @@
<link href="<?php bloginfo('pingback_url');?>" rel="pingback"/>
<?php wp_head(); ?>
<!--[if lt IE 9]>
- <script src="<?php print $childDir; ?>/assets/js/vendor/html5shiv.min.js"></script>
- <script src="<?php print $childDir; ?>/assets/js/vendor/respond.min.js"></script>
+ <script src="<?php bloginfo('template_directory'); ?>/assets/js/vendor/html5shiv.min.js"></script>
+ <script src="<?php bloginfo('template_directory'); ?>/assets/js/vendor/respond.min.js"></script>
<![endif]-->
</head>
<body <?php body_class(''); ?> itemscope itemtype="http://schema.org/Blog">
@@ -87,7 +87,7 @@ function bootpresswp_breadcrumbs() {
if (get_query_var('paged')) {
if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())
echo ' (';
- echo __('Page', 'bootstrapwp') . ' ' . get_query_var('paged');
+ echo __('Page', 'bootpresswp') . ' ' . get_query_var('paged');
if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())
echo ')';
}
@@ -8,8 +8,8 @@ function wp_bootstrap_pagination( $args = array() ) {
$defaults = array(
'range' => 4,
'custom_query' => FALSE,
- 'previous_string' => __( '<i class="glyphicon glyphicon-chevron-left"></i>', 'text-domain' ),
- 'next_string' => __( '<i class="glyphicon glyphicon-chevron-right"></i>', 'text-domain' ),
+ 'previous_string' => __( '<i class="glyphicon glyphicon-chevron-left"></i>', 'bootpresswp' ),
+ 'next_string' => __( '<i class="glyphicon glyphicon-chevron-right"></i>', 'bootpresswp' ),
'before_output' => '<div class="post-nav"><ul class="pager" class="pagination" role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">',
'after_output' => '</ul></div>'
);
@@ -54,10 +54,10 @@ function wp_bootstrap_pagination( $args = array() ) {
$firstpage = esc_attr( get_pagenum_link(1) );
if ( $firstpage && (1 != $page) )
- $echo .= '<li class="previous"><a rel="prev" itemprop="name" href="' . $firstpage . '">' . __( 'First', 'text-domain' ) . '</a></li>';
+ $echo .= '<li class="previous"><a rel="prev" itemprop="name" href="' . $firstpage . '">' . __( 'First', 'bootpresswp' ) . '</a></li>';
if ( $previous && (1 != $page) )
- $echo .= '<li><a rel="prev" href="' . $previous . '" title="' . __( 'previous', 'text-domain') . '">' . $args['previous_string'] . '</a></li>';
+ $echo .= '<li><a rel="prev" href="' . $previous . '" title="' . __( 'previous', 'bootpresswp') . '">' . $args['previous_string'] . '</a></li>';
if ( !empty($min) && !empty($max) ) {
for( $i = $min; $i <= $max; $i++ ) {
@@ -72,11 +72,11 @@ function wp_bootstrap_pagination( $args = array() ) {
$next = intval($page) + 1;
$next = esc_attr( get_pagenum_link($next) );
if ($next && ($count != $page) )
- $echo .= '<li><a rel="next" itemprop="name" href="' . $next . '" title="' . __( 'next', 'text-domain') . '">' . $args['next_string'] . '</a></li>';
+ $echo .= '<li><a rel="next" itemprop="name" href="' . $next . '" title="' . __( 'next', 'bootpresswp') . '">' . $args['next_string'] . '</a></li>';
$lastpage = esc_attr( get_pagenum_link($count) );
if ( $lastpage ) {
- $echo .= '<li class="next"><a rel="next" itemprop="name" href="' . $lastpage . '">' . __( 'Last', 'text-domain' ) . '</a></li>';
+ $echo .= '<li class="next"><a rel="next" itemprop="name" href="' . $lastpage . '">' . __( 'Last', 'bootpresswp' ) . '</a></li>';
}
if ( isset($echo) )
@@ -1,185 +0,0 @@
-<?php
-
-/*
- * Bootstrap 3 Shortcodes for BootpressWP
- */
-
-// Carosel Shortcode
-// [carosel][/carosel]
-function carosel_shortcode( $atts , $content = null ) {
-
-// Attributes
- extract( shortcode_atts(
- array(
- 'id' => 'myCarousel',
- ), $atts )
- );
-
-return '<div class="row-fluid" style="position:relative"><div class="span1"><a class="carousel-control left" href="#' . $id . '" data-slide="prev"><img src="http://d-core.co.za/wp-content/themes/child-core/assets/img/dcore/backwards.png"></a></div><div class="span10"><div id="' . $id . '" class="carousel slide"><ol class="carousel-indicators"></ol><div class="carousel-inner">' . do_shortcode($content) . '</div></div></div><div class="span1"><a class="carousel-control right" href="#' . $id . '" data-slide="next"><img src="http://d-core.co.za/wp-content/themes/child-core/assets/img/dcore/forward.png"></a></div></div>';
-}
-add_shortcode( 'carosel', 'carosel_shortcode' );
-
-
-// Carosel Image
-//[caroselimg class=""]Image File[/caroselimg]
-function caroselshortcode($atts, $content = null) {
- extract(shortcode_atts(
- array(
- 'class' => '',
- ), $atts)
- );
- return '<div class="item ' . $class . '">' . do_shortcode($content) . '</div>';
-}
-add_shortcode('caroselimg', 'caroselshortcode');
-
-
-// Row Fluid Short Code
-// [row][/row]
-function row_shortcode($atts, $content = null) {
- return '<div class="row">' . do_shortcode($content) . '</div>';
-}
-add_shortcode('row', 'row_shortcode');
-
-
-// Column Shortcode
-/* [col xsmall="" small="" medium="" large="" class=""]Here is the content[/col]
- * Always remeber no spaces between columns
- */
-function col_shortcode($atts, $content = null) {
- extract(shortcode_atts(
- array(
- 'xsmall' => '',
- 'small' => '',
- 'medium' => '12',
- 'large' => '',
- 'class' => '',
- ), $atts)
- );
- // Check to see if offset is empty, if empty then remove from return code
- $xsmalltest = "";
- $smalltest = "";
- $mediumtest = "";
- $largetest = "";
- $classtest = "";
-
- if ($xsmall != "") {
- $xsmalltest = 'col-xs-' . $xsmall . ' ';
- };
- if ($small != "") {
- $smalltest = 'col-sm-' . $small . ' ';
- };
- if ($medium != "") {
- $mediumtest = 'col-md-' . $medium . ' ';
- };
- if ($large != "") {
- $largetest = 'col-lg-' . $large;
- };
- if ($class != "") {
- $classtest = ' ' . $class;
- };
- return '<div class="' . $xsmalltest . $smalltest . $mediumtest . $largetest . $classtest . '">' . do_shortcode($content) . '</div>';
-}
-add_shortcode('col', 'col_shortcode');
-
-
-
-// Button Shortcodes
-// [btn href="test" type="btn-danger" size="btn-large" disabled="disabled"]Here is the content[/btn]
-// Add Shortcode
-function btnshort_shortcode($atts, $content = null) {
- extract(shortcode_atts(
- array(
- 'href' => '',
- 'type' => '',
- 'size' => '',
- 'disabled' => '',
- ), $atts)
- );
- return '<a href="' . $href . '" class="btn ' . $type . ' ' . $size . ' ' . $disabled . '">' . do_shortcode($content) . '</a>';
-}
-add_shortcode('btnshort', 'btnshort_shortcode');
-
-
-// Label Short Code
-// [label type=""]here is content[/label]
-function label_shortcode($atts, $content = null) {
- extract(shortcode_atts(
- array(
- 'type' => '',
- ), $atts)
- );
- return '<span class="label ' . $type . '">' . $content . '</span>';
-}
-add_shortcode('label', 'label_shortcode');
-
-
-// Badge Shortcode
-//[badge type=""]here is content[/badge]
-function badge_shortcode($atts, $content = null) {
- extract(shortcode_atts(
- array(
- 'type' => '',
- ), $atts)
- );
- return '<span class="badge ' . $type . '">' . $content . '</span>';
-}
-add_shortcode('badge', 'badge_shortcode');
-
-
-// Hero Shortcode
-// [hero headline="" href="test" type="btn-danger" size="btn-large" buttontext=""]Here is the content[/hero]
-function hero_shortcode($atts, $content = null) {
- extract(shortcode_atts(
- array(
- 'headline' => '',
- 'href' => '',
- 'type' => 'btn-primary',
- 'size' => 'btn-large',
- 'buttontext' => 'Learn More',
- ), $atts)
- );
- return '<div class="hero-unit"><h1>' . $headline . '</h1><p>' . $content . '</p><p><a href="' . $href . '" class="btn ' . $type . ' ' . $size . '">' . $buttontext . '</a></p></div>';
-}
-add_shortcode('hero', 'hero_shortcode');
-
-
-// Headline Shortcode
-//[head headline="" subtext=""]
-function head_shortcode($atts) {
- extract(shortcode_atts(
- array(
- 'headline' => 'Headline',
- 'subtext' => 'Subtext',
- ), $atts)
- );
- return '<div class="page-header"><h1>' . $headline . ' <small>' . $subtext . '</small></h1></div>';
-}
-add_shortcode('head', 'head_shortcode');
-
-
-//Modal
-// Add Shortcode
-//[modal title=""][/modal]
-function modal_shortcode($atts, $content = null) {
- extract(shortcode_atts(
- array(
- 'title' => 'Modal Title',
- ), $atts)
- );
-
- $returnString = '<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">';
- $returnString .= '<div class="modal-header">';
- $returnString .= '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>';
- $returnString .= '<h3 id="myModalLabel">' . $title . '</h3>';
- $returnString .= '</div>';
- $returnString .= '<div class="modal-body">';
- $returnString .= do_shortcode($content);
- $returnString .= '</div>';
- $returnString .= '<div class="modal-footer">';
- $returnString .= '<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>';
- $returnString .= '</div>';
- $returnString .= '</div>';
-
- return $returnString;
-}
-add_shortcode('modal', 'modal_shortcode');
Oops, something went wrong.

0 comments on commit a60ddaa

Please sign in to comment.