Skip to content

Instantly share code, notes, and snippets.

@kstrohm
kstrohm / functions.php
Last active September 19, 2025 20:23
function for Boom to use for GMC
<?php
function titlebrand_shortcode() {
global $product;
$tbs_brand = implode(', ', wp_get_post_terms($product->get_id(), 'product_brand', ['fields' => 'names']));
$tbs_SEOline = get_post_meta($product->get_id(), '_custom_product_title_field', true);
$tbs_title = get_the_title();
$brandWatch = ["Springfree", "AlleyOOP", "NORTH"];
foreach ($brandWatch as $brandWatch) {
@kstrohm
kstrohm / admin-functions.php
Last active July 12, 2025 23:55
Wordpress function for manipulating title and brands with request to leave product title for google merchant center
<?php
/* script to add css sheet addition drop in functions.php */
add_action('admin_head', 'admin_styles');
function admin_styles() {
echo '<link rel="stylesheet" href="'. get_stylesheet_directory_uri() . '/css/admin-styles.css" type="text/css" media="all" />';
}
@kstrohm
kstrohm / woo_brands.php
Created July 3, 2025 22:25
Show product title with brand - WooCommerce
<?php
/* -------- Show product title with brand span -------- */
/*
from what it appears woo makes it easy to show brand images, but not the name
First two done in shortcode as it was applied to a site using a builder
1. titlebrand_shortcode