Skip to content

Instantly share code, notes, and snippets.

<?php
function category_layout_full() {
if ( is_category() ) {
add_filter( 'shoestrap_forced_layout', 'ssep_return_f' );
}
}
add_action( 'wp', 'category_layout_full' );
@fovoc
fovoc / functions.php
Last active August 29, 2015 14:08
Shoestrap 3 - move secondary navbar inside main header tag
<?php
function move_secondary_navbar() {
global $ss_menus;
// remove secondary navbar
remove_action( 'shoestrap_pre_wrap', array( $ss_menus, 'secondary_navbar' ) );
// place it inside the very end of main header tag
add_action( 'shoestrap_post_main_nav', array( $ss_menus, 'secondary_navbar' ), 1 );
// leave it outside the header tag, but on the very top
//add_action( 'shoestrap_pre_wrap', array( $ss_menus, 'secondary_navbar' ), 1 );
<?php
function my_shoestrap_content_override() {
global $ss_framework;
echo '<article '; post_class(); echo '>';
do_action( 'shoestrap_in_article_top' );
shoestrap_title_section( true, 'h2', true );
if ( has_action( 'shoestrap_entry_meta_override' ) ) {
@fovoc
fovoc / functions.php
Created October 29, 2014 16:07
Shoestrap 3 - layout per category
<?php
function category_layout_full() {
if ( is_category('uncategorized') ) {
add_filter( 'shoestrap_forced_layout', 'ssep_return_f' );
}
}
add_action( 'wp', 'category_layout_full' );
@fovoc
fovoc / functions.php
Last active August 29, 2015 14:08
Shoestrap 3 - add social share button in top navbar
<?php
function navbar_sharing() {
global $ss_social;
add_action( 'shoestrap_inside_nav_begin', array( $ss_social, 'social_sharing' ) );
// add_action( 'shoestrap_inside_nav_end', array( $ss_social, 'social_sharing' ) );
// add_action( 'shoestrap_pre_main_nav', array( $ss_social, 'social_sharing' ) );
// add_action( 'shoestrap_post_main_nav', array( $ss_social, 'social_sharing' ) );
}
add_action( 'wp', 'navbar_sharing' );
@fovoc
fovoc / functions.php
Last active August 29, 2015 14:07
Random Post Button
<?php
add_action('init','random_post');
function random_post() {
global $wp;
$wp->add_query_var('random');
add_rewrite_rule('random/?$', 'index.php?random=1', 'top');
}
add_action('template_redirect','random_template');
@fovoc
fovoc / product-thumbnails.php
Created October 20, 2014 17:33
Shoestrap 3 Woo Child
<?php
function woocommerce_get_product_thumbnail( $size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0 ) {
global $post;
if ( has_post_thumbnail() ) {
echo '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( $post->post_title ) . '">'. get_the_post_thumbnail( $post->ID, $size ) .'</a>';
}
elseif ( wc_placeholder_img_src() ) {
return wc_placeholder_img( $size );
}
@fovoc
fovoc / functions.php
Last active August 29, 2015 14:07
Shoestrap 3 v.3.2.8 - Remove top-bar menu in specific pages
<?php
/**
* Remove top-bar menu in specific pages
*/
function no_top_bar_template( $template ) {
if ( is_page(501) || is_home() ) {
add_filter( 'shoestrap_top_bar_template', '__return_false' );
} else {
return $template;
}
@fovoc
fovoc / functions.php
Created October 10, 2014 10:07
Shoestrap 3 - remove sidebars in 404 pages (temp bugfix)
<?php
/**
* Remove primary sidebar in 404 pages
*/
function remove_404_sidebar() {
if ( is_404() ) {
add_filter( 'shoestrap_display_primary_sidebar', '__return_false' );
}
}
@fovoc
fovoc / functions.php
Created October 7, 2014 10:20
Shoestrap 3 Gridder with Before Index Extra Widgets Area
<?php
add_action( 'shoestrap_index_begin', 'gridder_wrapper_open', 999 );
function gridder_wrapper_open() {
echo '<div id="gridder_wrapper">';
}
add_action( 'shoestrap_index_end', 'gridder_wrapper_close', 1 );
function gridder_wrapper_close() {
echo '</div>';