Formatting, adding/updating links
This commit is contained in:
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ function roots_request_filter($query_vars) {
|
|||||||
add_filter('request', 'roots_request_filter');
|
add_filter('request', 'roots_request_filter');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell WordPress to use searchform.php from the templates/ directory. Requires WordPress 3.6+
|
* Tell WordPress to use searchform.php from the templates/ directory
|
||||||
*/
|
*/
|
||||||
function roots_get_search_form($form) {
|
function roots_get_search_form($form) {
|
||||||
$form = '';
|
$form = '';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Use Bootstrap's media object for listing comments
|
* Use Bootstrap's media object for listing comments
|
||||||
*
|
*
|
||||||
* @link http://twitter.github.com/bootstrap/components.html#media
|
* @link http://getbootstrap.com/components/#media
|
||||||
*/
|
*/
|
||||||
class Roots_Walker_Comment extends Walker_Comment {
|
class Roots_Walker_Comment extends Walker_Comment {
|
||||||
function start_lvl(&$output, $depth = 0, $args = array()) {
|
function start_lvl(&$output, $depth = 0, $args = array()) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* Re-create the [gallery] shortcode and use thumbnails styling from Bootstrap
|
* Re-create the [gallery] shortcode and use thumbnails styling from Bootstrap
|
||||||
* The number of columns must be a factor of 12.
|
* The number of columns must be a factor of 12.
|
||||||
*
|
*
|
||||||
* @link http://twbs.github.io/bootstrap/components/#thumbnails
|
* @link http://getbootstrap.com/components/#thumbnails
|
||||||
*/
|
*/
|
||||||
function roots_gallery($attr) {
|
function roots_gallery($attr) {
|
||||||
$post = get_post();
|
$post = get_post();
|
||||||
@@ -88,16 +88,16 @@ function roots_gallery($attr) {
|
|||||||
$image = ('file' == $link) ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
|
$image = ('file' == $link) ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
|
||||||
$output .= ($i % $columns == 0) ? '<div class="row gallery-row">': '';
|
$output .= ($i % $columns == 0) ? '<div class="row gallery-row">': '';
|
||||||
$output .= '<div class="' . $grid .'">' . $image;
|
$output .= '<div class="' . $grid .'">' . $image;
|
||||||
|
|
||||||
if (trim($attachment->post_excerpt)) {
|
if (trim($attachment->post_excerpt)) {
|
||||||
$output .= '<div class="caption hidden">' . wptexturize($attachment->post_excerpt) . '</div>';
|
$output .= '<div class="caption hidden">' . wptexturize($attachment->post_excerpt) . '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
$i++;
|
$i++;
|
||||||
$output .= ($i % $columns == 0) ? '</div>' : '';
|
$output .= ($i % $columns == 0) ? '</div>' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= ($i % $columns != 0 ) ? '</div>' : '';
|
$output .= ($i % $columns != 0 ) ? '</div>' : '';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,12 @@
|
|||||||
*
|
*
|
||||||
* If any of the is_* conditional tags or is_page_template(template_file) checks return true, the sidebar will NOT be displayed.
|
* If any of the is_* conditional tags or is_page_template(template_file) checks return true, the sidebar will NOT be displayed.
|
||||||
*
|
*
|
||||||
|
* @link http://roots.io/the-roots-sidebar/
|
||||||
|
*
|
||||||
* @param array list of conditional tags (http://codex.wordpress.org/Conditional_Tags)
|
* @param array list of conditional tags (http://codex.wordpress.org/Conditional_Tags)
|
||||||
* @param array list of page templates. These will be checked via is_page_template()
|
* @param array list of page templates. These will be checked via is_page_template()
|
||||||
*
|
*
|
||||||
* @return boolean True will display the sidebar, False will not
|
* @return boolean True will display the sidebar, False will not
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class Roots_Sidebar {
|
class Roots_Sidebar {
|
||||||
private $conditionals;
|
private $conditionals;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Theme wrapper
|
* Theme wrapper
|
||||||
*
|
*
|
||||||
|
* @link http://roots.io/an-introduction-to-the-roots-theme-wrapper/
|
||||||
* @link http://scribu.net/wordpress/theme-wrappers.html
|
* @link http://scribu.net/wordpress/theme-wrappers.html
|
||||||
*/
|
*/
|
||||||
function roots_template_path() {
|
function roots_template_path() {
|
||||||
@@ -19,21 +20,21 @@ class Roots_Wrapping {
|
|||||||
// Stores the base name of the template file; e.g. 'page' for 'page.php' etc.
|
// Stores the base name of the template file; e.g. 'page' for 'page.php' etc.
|
||||||
static $base;
|
static $base;
|
||||||
|
|
||||||
public function __construct($template='base.php') {
|
public function __construct($template = 'base.php') {
|
||||||
$this->slug = basename($template, '.php');
|
$this->slug = basename($template, '.php');
|
||||||
$this->templates = array($template);
|
$this->templates = array($template);
|
||||||
|
|
||||||
if (self::$base) {
|
if (self::$base) {
|
||||||
$str = substr($template, 0, -4);
|
$str = substr($template, 0, -4);
|
||||||
array_unshift($this->templates, sprintf($str . '-%s.php', self::$base));
|
array_unshift($this->templates, sprintf($str . '-%s.php', self::$base));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
$this->templates = apply_filters('roots_wrap_' . $this->slug, $this->templates);
|
$this->templates = apply_filters('roots_wrap_' . $this->slug, $this->templates);
|
||||||
return locate_template($this->templates);
|
return locate_template($this->templates);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function wrap($main) {
|
static function wrap($main) {
|
||||||
self::$main_template = $main;
|
self::$main_template = $main;
|
||||||
self::$base = basename(self::$main_template, '.php');
|
self::$base = basename(self::$main_template, '.php');
|
||||||
@@ -41,7 +42,7 @@ class Roots_Wrapping {
|
|||||||
if (self::$base === 'index') {
|
if (self::$base === 'index') {
|
||||||
self::$base = false;
|
self::$base = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Roots_Wrapping();
|
return new Roots_Wrapping();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
page.php
2
page.php
@@ -1,2 +1,2 @@
|
|||||||
<?php get_template_part('templates/page', 'header'); ?>
|
<?php get_template_part('templates/page', 'header'); ?>
|
||||||
<?php get_template_part('templates/content', 'page'); ?>
|
<?php get_template_part('templates/content', 'page'); ?>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<?php get_template_part('templates/content', 'single'); ?>
|
<?php get_template_part('templates/content', 'single'); ?>
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ Template Name: Custom Template
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?php get_template_part('templates/page', 'header'); ?>
|
<?php get_template_part('templates/page', 'header'); ?>
|
||||||
<?php get_template_part('templates/content', 'page'); ?>
|
<?php get_template_part('templates/content', 'page'); ?>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?php while (have_posts()) : the_post(); ?>
|
<?php while (have_posts()) : the_post(); ?>
|
||||||
<?php the_content(); ?>
|
<?php the_content(); ?>
|
||||||
<?php wp_link_pages(array('before' => '<nav class="pagination">', 'after' => '</nav>')); ?>
|
<?php wp_link_pages(array('before' => '<nav class="pagination">', 'after' => '</nav>')); ?>
|
||||||
<?php endwhile; ?>
|
<?php endwhile; ?>
|
||||||
|
|||||||
@@ -7,4 +7,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<?php wp_footer(); ?>
|
<?php wp_footer(); ?>
|
||||||
|
|||||||
@@ -11,4 +11,4 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
<h1>
|
<h1>
|
||||||
<?php echo roots_title(); ?>
|
<?php echo roots_title(); ?>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<?php dynamic_sidebar('sidebar-primary'); ?>
|
<?php dynamic_sidebar('sidebar-primary'); ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user