Skip to content

Instantly share code, notes, and snippets.

WPStudio frankschrijvers

Block or report user

Report or block frankschrijvers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@frankschrijvers
frankschrijvers / functions.php
Created Sep 19, 2016
Change add to cart button text per category archive pages
View functions.php
<?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 Oct 24, 2016
Change add to cart button text per category
View functions.php
<?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 Sep 19, 2016
Change add to cart button text archive pages
View functions.php
<?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 Feb 12, 2019
Change add to cart button text
View functions.php
<?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 Sep 15, 2016
Styling sidebars Whitespace Pro
View style.css
/* Sidebar
---------------------------------------------------------------------------------------------------- */
.content-sidebar .content,
.sidebar-content .content {
width: 100%;
}
.content-sidebar .sidebar-primary,
.sidebar-content .sidebar-primary {
width: 100%;
@frankschrijvers
frankschrijvers / functions.php
Created Sep 15, 2016
remove forced full width layout
View functions.php
//* Force full-width-content layout setting
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
@frankschrijvers
frankschrijvers / functions.php
Created Sep 15, 2016
Activate default sidebar
View functions.php
unregister_sidebar( 'sidebar' );
@frankschrijvers
frankschrijvers / functions.php
Created Sep 15, 2016
remove unregister sidebars
View functions.php
genesis_unregister_layout( 'content-sidebar' );
genesis_unregister_layout( 'sidebar-content' );
@frankschrijvers
frankschrijvers / functions.php
Last active Feb 12, 2019
Add Email This Option to Bottom of Post
View functions.php
<?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>';
View text.txt
<p class="intro>....your text here.....</p>
You can’t perform that action at this time.