Skip to content

Instantly share code, notes, and snippets.

@fovoc
fovoc / functions.php
Last active December 31, 2015 05:59 — forked from sloped/paging.php
Bootstrap3 style pagination for Shoestrap 3 theme
<?php
//Use this function to create pagingation links that are styleable with Bootstrap 3
function paging() {
global $wp_query;
$total_pages = $wp_query->max_num_pages;
if ($total_pages > 1){
$current_page = max(1, get_query_var('paged'));
<?php
/*
* The page core options for the Shoestrap theme
*/
if ( !function_exists( 'shoestrap_module_coulourlovers_options' ) ) :
function shoestrap_module_coulourlovers_options( $sections ) {
// Page Options
function my_shoestrap_content_override() {
?>
<article <?php post_class(); ?>>
<?php do_action( 'shoestrap_in_article_top' ); ?>
<header>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php do_action( 'shoestrap_entry_meta_override' ); ?>
</header>
<div class="entry-content">
<?php do_action( 'shoestrap_single_pre_content' ); ?>
@fovoc
fovoc / functions.core.php
Created February 5, 2014 17:14
shoestrap-3 / lib / modules / compiler / includes / functions.core.php
<?php
if ( !function_exists( 'shoestrap_css' ) ) :
/*
* Gets the css path or url to the stylesheet
* If $target = 'path', return the path
* If $target = 'url', return the url
*
* If echo = true then print the path or url.
<?php
if ( $pagination == 'pager' ) :
if ($wp_query->max_num_pages > 1) :
$current_page = max(1, get_query_var('paged'));
?>
<nav class="post-nav">
<ul class="pager">
<li class="previous"><?php next_posts_link(__('&larr; Older posts', 'roots')); ?></li>
<li class="text-center"><?php echo $current_page.' of '.$wp_query->max_num_pages; ?></li>
<?php
if ( !function_exists( 'shoestrap_compiler' ) ) :
/*
* This function can be used to compile a less file to css using the lessphp compiler
*/
function shoestrap_compiler() {
$minimize_css = shoestrap_getVariable( 'minimize_css', true );
$options = ( $minimize_css == 1 ) ? array( 'compress'=>true ) : array( 'compress'=>false );
@fovoc
fovoc / functions.php
Last active August 29, 2015 13:57
How to change homepage title in Shoestrap 3.1.0.2
/*
* Change homepage title
*/
function shoestrap_new_homepage_title() {
echo 'My new title';
}
function shoestrap_change_homepage_title() {
if (is_home()) {
add_action( 'shoestrap_page_header_override', 'shoestrap_new_homepage_title' );
function remove_shoestrap_navbar_slidedown_toggle(){
global $ss_settings, $ss_menus;
$hook_navbar_slidedown_toggle = ( $ss_settings['navbar_toggle'] == 'left' ) ? 'shoestrap_pre_content' : 'shoestrap_inside_nav_begin';
remove_action( $hook_navbar_slidedown_toggle, array( $ss_menus, 'navbar_slidedown_toggle' ) );
}
add_action( 'wp', 'remove_shoestrap_navbar_slidedown_toggle' );
function my_navbar_slidedown_toggle() {
@fovoc
fovoc / functions.php
Created April 1, 2014 16:34
Disable Shoestrap 3 Gridder from homepage (this file should be placed in wp-content/mu-plugins/ folder, the homepage should be set manually)
<?php
add_filter( 'option_active_plugins', 'disable_gridder_in_homepage' );
function disable_gridder_in_homepage($plugins){
$homepage = 'local.wordpress.dev/';
if( ( $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']) == $homepage ) {
$key = array_search( 'shoestrap-gridder/shoestrap-gridder.php' , $plugins );
// add custom footer via shoestrap_footer_override action
function my_custom_footer_override() {
global $ss_footer;
?>
<div id="footer">