Skip to content

Instantly share code, notes, and snippets.

@thecodepoetry
thecodepoetry / brandin.php
Created April 27, 2015 12:37
site title link
<div id="site-title" class="<?php echo $site_title_class; ?>"><?php bloginfo( 'name' ); ?></div>
to
<div id="site-title" class="<?php echo $site_title_class; ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></div>
@thecodepoetry
thecodepoetry / gist:e774e2510a231998b800
Last active August 29, 2015 14:21
Disable sidebar globally in pages, this will overwrite your individual page settings
add_action( 'get_header', 'dt_disable_sidebar', 10 );
function dt_disable_sidebar() {
$config = Presscore_Config::get_instance();
if(is_page()){
$config->set( 'sidebar_position', 'disabled' );
}
}
edit section
if ( $title ) {
$title = '<div class="team-author-name">' . $title . '</div>';
to
if ( $title ) {
if ( 'post' == $config->get( 'post.open_as' ) ) {
@thecodepoetry
thecodepoetry / team-post-content.php
Created June 4, 2015 19:08
Read more link team member
$content = apply_filters( 'the_excerpt', get_the_excerpt() );
$content = $content.'<a href="'.get_permalink().'">read more</a>'; //new line
<?php
/**
* The Header for single posts.
*
* Do not content header-main-content-open template part!
@thecodepoetry
thecodepoetry / functions.php
Created August 10, 2015 07:46
Remove short-code insert from classic text editor
function dt_editor_remove_short_code_buttons( $plugin_array ) {
if( isset( $plugin_array['vogue_shortcodes'] ) ) {
unset( $plugin_array['vogue_shortcodes'] );
}
return $plugin_array;
}
add_filter( 'mce_external_plugins', 'dt_editor_remove_short_code_buttons', 99, 1 );
function dt_editor_cancel_short_code_buttons( $buttons ) {
if(isset( $buttons['vogue_chortcodes_megabutton'] ) ) {
@thecodepoetry
thecodepoetry / functions.php
Last active August 29, 2015 14:27
Add fancy header to woocommerce product category
function dt_product_category_config() {
if( is_product_category( 'digital-goods' ) ) {
$pagid = 34843; //header, sidebar, footer settings of the page id given will applie to product categiry
$config = presscore_get_config( );
presscore_config_base_init( $pagid );
}
}
add_action( 'get_header', 'dt_product_category_config', 10 );
@thecodepoetry
thecodepoetry / functions.php
Created September 8, 2015 04:33
Add product description on shop page
add_action( 'woocommerce_after_shop_loop_item_title', 'dt_woocommerce_product_excerpt', 35, 2);
function dt_woocommerce_product_excerpt()
{
echo '<span class="excerpt">';
the_excerpt();
echo '</span>';
}
@thecodepoetry
thecodepoetry / style.css
Created October 28, 2015 08:23
sticky topbar
@media only screen and (min-width: 739px) {
#top-bar {
position:fixed !important;
top: 0px !important;
width: 100% !important;
z-index: 9999 !important;
}
#header {
margin-top: 27px !important;
}
@thecodepoetry
thecodepoetry / funtions.php
Last active November 24, 2015 19:22
Change header layout
add_action( 'get_header', 'dt_archive_layout', 10 );
function dt_archive_layout() {
$config = Presscore_Config::get_instance();
if(is_page( 35 )){
$config->set( 'header.layout', 'inline' );
}