Skip to content

Instantly share code, notes, and snippets.

View frankschrijvers's full-sized avatar

WPStudio frankschrijvers

View GitHub Profile
@frankschrijvers
frankschrijvers / functions.php
Created September 19, 2016 08:49
Change add to cart button text per category archive pages
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Change add to cart button text per category archive pages
add_filter( 'woocommerce_product_add_to_cart_text', 'wps_archive_custom_cart_button_text' );
function wps_archive_custom_cart_button_text() {
global $product;
$terms = get_the_terms( $product->ID, 'product_cat' );
foreach ($terms as $term) {
@frankschrijvers
frankschrijvers / functions.php
Last active July 17, 2021 04:07
Change add to cart button text per category
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Change add to cart button text per category
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wps_custom_cart_button_text' );
function wps_custom_cart_button_text() {
global $product;
$terms = get_the_terms( $product->ID, 'product_cat' );
foreach ($terms as $term) {
@frankschrijvers
frankschrijvers / functions.php
Created September 19, 2016 08:22
Change add to cart button text archive pages
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Change add to cart button text archive pages
add_filter( 'woocommerce_product_add_to_cart_text', 'wps_archive_custom_cart_button_text' );
function wps_archive_custom_cart_button_text() {
return __( 'Buy Product', 'your_theme_text_domain' );
@frankschrijvers
frankschrijvers / functions.php
Last active July 17, 2021 04:07
Change add to cart button text
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Change add to cart button text single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wps_custom_cart_button_text' );
function wps_custom_cart_button_text() {
return __( 'Buy Product', 'your_theme_text_domain' );
@frankschrijvers
frankschrijvers / style.css
Last active September 15, 2016 08:10
Styling sidebars Whitespace Pro
/* Sidebar
---------------------------------------------------------------------------------------------------- */
.content-sidebar .content,
.sidebar-content .content {
width: 100%;
}
.content-sidebar .sidebar-primary,
.sidebar-content .sidebar-primary {
width: 100%;
@frankschrijvers
frankschrijvers / functions.php
Created September 15, 2016 07:49
remove forced full width layout
//* Force full-width-content layout setting
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
@frankschrijvers
frankschrijvers / functions.php
Created September 15, 2016 07:43
Activate default sidebar
unregister_sidebar( 'sidebar' );
@frankschrijvers
frankschrijvers / functions.php
Created September 15, 2016 07:36
remove unregister sidebars
genesis_unregister_layout( 'content-sidebar' );
genesis_unregister_layout( 'sidebar-content' );
@frankschrijvers
frankschrijvers / functions.php
Last active February 12, 2019 22:23
Add Email This Option to Bottom of Post
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add Email This Option to Bottom of Post
add_filter( 'the_content', 'wps_add_email_this_button' );
function wps_add_email_this_button($content){
if (is_single()) {
$content .= '<a class="mail-btn" href="mailto:?subject=' . get_the_title() . '&amp;body=' . get_the_permalink() . '" title="Send this article to a friend!">Email this</a>';
@frankschrijvers
frankschrijvers / text.txt
Created July 6, 2016 20:54
first paragraph
<p class="intro>....your text here.....</p>