This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'post_class', function( $classes ) { | |
// Check if WooCommerce is active | |
if ( ! class_exists( 'WC_Product' ) ) { | |
return $classes; | |
} | |
global $post; | |
$custom_classes = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generate custom archive links for current category by year | |
function get_category_archive_links_by_year($cat_id) { | |
global $wpdb; | |
// Get years with posts in the current category along with post count | |
$years_with_count = $wpdb->get_results( | |
"SELECT YEAR(post_date) AS year, COUNT(ID) AS post_count | |
FROM $wpdb->posts | |
INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) | |
INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function category_list_with_images_shortcode($atts) { | |
$atts = shortcode_atts(array( | |
'parent_category' => '', // Default to empty (no specific parent category) | |
), $atts); | |
$parent_category = $atts['parent_category']; | |
if (empty($parent_category) && is_category()) { | |
// if no parent_category and is_category then use current term |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add custom meta box | |
function add_full_width_meta_box() { | |
$post_types = array('post', 'page'); // Add more post types if needed | |
foreach ($post_types as $post_type) { | |
add_meta_box( | |
'full-width-meta-box', | |
'Full Width', | |
'full_width_meta_box_callback', | |
$post_type, | |
'side', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form.pmpro_form .pmpro_checkout-field, | |
form.pmpro_form .pmpro_change_password-fields div { | |
display: flex; | |
flex-wrap: wrap; | |
} | |
form.pmpro_form input:not(.pmpro_btn-cancel,[type="submit"]), | |
.pmpro_login_wrap input:not([type="submit"]) { | |
display: block; | |
order: 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function category_posts_shortcode() { | |
// Get all categories with posts | |
$categories = get_categories(array( | |
'hide_empty' => 1 | |
)); | |
$output = '<ul class="category-list">'; | |
// Loop through each category |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1 { | |
display: block; | |
font-size: 80px; | |
font-weight: 900; | |
background: linear-gradient(90deg, var(--accent), var(--global-color-8)); | |
-webkit-background-clip: text; | |
background-clip: text; | |
-webkit-text-fill-color: transparent; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- wp:html --> | |
<style> | |
.gb-tabs__button.gb-block-is-current .icon-not-current, | |
.gb-tabs__button:not(.gb-block-is-current ) .icon-current{ | |
display: none; | |
} | |
</style> | |
<!-- /wp:html --> | |
<!-- wp:generateblocks/container {"uniqueId":"db7fbf3c","backgroundColor":"#181b29","gradientDirection":30,"gradientColorOne":"#17143a","gradientColorTwo":"#1f1d54","textColor":"var(\u002d\u002dbase-3)","isDynamic":true,"blockVersion":3,"paddingTop":"60","paddingRight":"40","paddingBottom":"60","paddingLeft":"40","paddingRightTablet":"30","paddingLeftTablet":"30","paddingRightMobile":"20","paddingLeftMobile":"20","textColorHover":"var(\u002d\u002dbase-3)"} --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PHP Snippet to create shortcode | |
// display nested list of posts by month year | |
function list_posts_by_month() { | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page' => -1, | |
'orderby' => 'date', | |
'order' => 'DESC' | |
); |
NewerOlder