Skip to content

Instantly share code, notes, and snippets.

@agusmu
agusmu / style.css
Created July 18, 2013 09:26
PrimaShop: Header Menu (Left) + Header Logo (Right)
/* move header title (logo) to the right */
#header-title {
float:right;
}
.header-logo-active #header-title, .header-logo-active #header-title .site-title, .header-logo-active #header-title .site-title a {
float:right !important;
background-position:right center !important;
}
/* move header title (logo) to the left */
#header-menu {
@agusmu
agusmu / functions.php
Created July 20, 2013 00:29
PrimaShop - Show "Call To Action" on homepage only
/* show "call to action" on homepage only */
add_filter( 'prima_get_setting_calltoaction', 'prima_show_calltoaction_homepage_only' );
function prima_show_calltoaction_homepage_only( $option ) {
if ( is_home() || is_front_page() ) {
return 1;
}
else {
return 0;
}
}
@agusmu
agusmu / style.css
Created July 20, 2013 08:47
PrimaShop - Full width style for featured header image
/* full width mode for featured header image */
#header-featured.header-image .margin, #header-featured.header-image-default .margin {
margin:0 !important;
padding:0 !important;
width:100% !important;
}
#header-featured.header-image img, #header-featured.header-image-default img {
width:100%;
}
@agusmu
agusmu / functions.php
Created July 20, 2013 10:12
PrimaShop - Show WPML Language Selector After Header Logo
add_action( 'prima_header_right', 'prima_custom_show_language_selector' );
function prima_custom_show_language_selector() {
do_action('icl_language_selector');
}
@agusmu
agusmu / style.css
Created July 20, 2013 15:04
WooCommerce - Hide product meta using CSS
/* hide SKU on product meta section */
.product_meta .sku_wrapper {
display:none;
}
/* hide product categories on product meta section */
.product_meta .posted_in {
display:none;
}
@agusmu
agusmu / style.css
Created July 24, 2013 07:18
PrimaShop - Customize Sidebar Text Color
/* sidebar text color */
#sidebar {
color: blue;
}
/* sidebar link color */
#sidebar a, #sidebar a:visited {
color: red;
}
/* sidebar hover link color */
#sidebar a:hover {
@agusmu
agusmu / functions.php
Last active December 20, 2015 04:09
PrimaShop - Responsive Logo
/* add responsive logo to header left area */
add_action( 'prima_header_left', 'prima_custom_responsive_logo', 5 );
function prima_custom_responsive_logo() {
$logo = prima_get_setting( 'header_logo' );
if ( $logo ) {
echo '<a href="'.home_url().'" class="header-logo"><img src="'.$logo.'" alt=""/></a>';
}
}
/* remove default header logo class */
@agusmu
agusmu / functions.php
Created July 24, 2013 08:42
WooCommerce - Adding category, excerpt, and SKU to shop page
/* Adding category, excerpt, and SKU to shop page */
add_action( 'woocommerce_after_shop_loop_item', 'prima_custom_shop_item', 5);
function prima_custom_shop_item() {
global $post, $product;
/* product categories */
$size = sizeof( get_the_terms( $post->ID, 'product_cat' ) );
echo $product->get_categories( ', ', '<p>' . _n( 'Category:', 'Categories:', $size, 'woocommerce' ) . ' ', '.</p>' );
/* product excerpt */
@agusmu
agusmu / functions.php
Created July 24, 2013 23:14
PrimaShop - move header content (logo+menu) to be beneath featured header
/* move header content (logo+menu) to be BENEATH featured header */
add_action( 'get_header', 'prima_custom_header_arrange' );
function prima_custom_header_arrange() {
/* remove the action */
remove_action( 'prima_header', 'prima_header_content_output', 20 );
remove_action( 'prima_header', 'prima_header_featured_output', 30 );
/* arrange with new priority */
add_action( 'prima_header', 'prima_header_featured_output', 20 );
add_action( 'prima_header', 'prima_header_content_output', 30 );
}
@agusmu
agusmu / functions.php
Created July 26, 2013 06:38
WooCommerce - Adding product categories (one category per line), excerpt, and SKU to shop page
/* Adding category, excerpt, and SKU to shop page */
add_action( 'woocommerce_after_shop_loop_item', 'prima_custom_shop_item', 5);
function prima_custom_shop_item() {
global $post, $product;
/* product categories */
$size = sizeof( get_the_terms( $post->ID, 'product_cat' ) );
echo $product->get_categories( '<br/>', '<p>', '</p>' );
/* product excerpt */