Skip to content

Instantly share code, notes, and snippets.

@wolfthemes
wolfthemes / overwrite-event-free-btn-txt.php
Created December 18, 2023 08:37
Overwriting Event "Free" button text
/**
* Overwriting Event "Free" button text
*/
add_filter( 'we_free_text', function( $text ) {
return esc_html__( 'Free Admission', 'wolf-events' );
} );
// Replace "theme_" with your theme slug
function theme_add_release_metaboxes( $metaboxes ) {
$metaboxes['release_options']['metafields'][] = array(
'label' => esc_html__( 'My New Option', '%TEXTDOMAIN%' ),
'id' => '_my_new_option',
'type' => 'text',
);
}
add_filter( 'theme_release_metaboxes', 'theme_add_release_metaboxes' );
$streaming_player_id = 10269; // your playlist ID
$streaming_player_url = 'http://dreamsiteradiocp3.com:8010/stream'; // your streaming URL
/**
* Overwrite sticky player tracklist to play audio streaming
*/
function radio_stream( $tracklist, $post_id ) {
global $streaming_player_id, $streaming_player_url;
seal.js, js/jquery/jquery.js,jarallax.min.js,particles.min.js,ofi.min.js
@wolfthemes
wolfthemes / filter-lightbox-settings.php
Last active July 25, 2018 12:22
Filter lightbox settings
/**
* Filter lightbox settings
*
* Allow you to add, remove or edit the fancybox gallery settings
*
* Replace the "theme_" prefix by your theme slug (e.g "hares_")
*
* @see https://fancyapps.com/fancybox/3/docs/#options
*/
function theme_custom_filter_lightbox_settings( $settings ) {
@wolfthemes
wolfthemes / single-post-top-featured-image.php
Created April 9, 2018 11:31
Output the post featured image at the begining of the post
/**
* Output the featured image at the begining of the post
*/
function output_featured_image() {
echo '<p>';
the_post_thumbnail( 'large' );
echo '</p>';
}
add_action( 'theme_post_content_start', 'output_featured_image' ); // replace "theme" by your theme slug
/**
* Exclude sticky posts from page.
*
* @param object $query
*/
function theme_name_ignore_sticky_posts( $query ) {
if ( 26 === get_the_ID() && is_page() && $query->is_main_query() ) { // 26 is your page ID
$query->set('post__not_in', get_option('sticky_posts') );
}
}
/**
* Disable menu icons
*/
function disable_menu_icons() {
remove_filter( 'walker_nav_menu_start_el', 'theme_nav_menu_social_icons' ); // replace "theme" by your theme slug (e.g "tune")
}
add_action( 'init', 'disable_menu_icons', 100 );
@wolfthemes
wolfthemes / overwrite-post-type-taxonomy-slug.php
Last active February 5, 2018 15:09
Overwrite custom post type taxonomy slug
<?php
/**
* Overwrite custom post type taxonomy slug
*
* @param array $args
* @param string $taxonomy
* @return array $args
*
*/
function overwrite_post_type_taxonomy_slug( $args, $taxonomy ) {