How to get rid of Ellipsis on Woocommerce [Essential] Theme [closed]
Use the excerpt_more filter: function wpse_180792_excerpt_more() { return ”; } add_filter( ‘excerpt_more’, ‘wpse_180792_excerpt_more’ );
Use the excerpt_more filter: function wpse_180792_excerpt_more() { return ”; } add_filter( ‘excerpt_more’, ‘wpse_180792_excerpt_more’ );
$metabox is not in the global scope, that is why your two functions is not working. If you turn debug on you will get a a lot of debugging notice error messages regarding the use of $metabox. Simply doing the following $metabox = new Metabox; doesn’t make a variable global. It need to be defined … Read more
You have to use single_product_large_thumbnail_size filter for Single Product page. something like: function custom_product_large_thumbnail_size() { return ‘gallery’; } add_filter(‘single_product_large_thumbnail_size’, ‘custom_product_large_thumbnail_size’);
If that is the sum of the code for that file then the only place near the bottom is that do_action— do_action( ‘shiroi_after_post_body_content’ );— which looks to be what you want. function test_new_action() { echo ‘Howdy’; } add_action(‘shiroi_after_post_body_content’,’test_new_action’); Depending upon how this file is included there might be other hooks. You can’t add code to … Read more
wc_enqueue_js is not method of $woocommerce object. Just call the function. wc_enqueue_js( file_get_contents( WOO_CK_PATH . ‘panel.js’ ) );
Change this code add_action( ‘after_setup_theme’, ‘right_sidebar_widget’ ); with add_action( ‘widgets_init’, ‘right_sidebar_widget’ );
You should hook save_post instead of publish_post. publish_post only runs when a post is initially published and won’t catch subsequent saves. Additionally, the publish_post hook passes parameters to your function and those should be used to retrieve info about the post being published rather get_the_content(), which only works when you’re inside the loop. I think … Read more
get_template_directory() gives you the path to the parent theme while get_stylesheet_directory() gives you the path to the child theme. Docs: https://codex.wordpress.org/Function_Reference/get_stylesheet_directory https://codex.wordpress.org/Function_Reference/get_template_directory
Ok, so the problem was that I was adding the variable outside the function. After some cleanup, code looks like this and it works! function roots_setup() { // Variables $header_type = get_field(‘header_type’,’options’); if (($header_type)==’brand-centered’) { register_nav_menus(array( ‘brand_centered_left’ => __(‘Brand Centered Navigation (Left)’, ‘roots’) )); register_nav_menus(array( ‘brand_centered_right’ => __(‘Brand Centered Navigation (Right)’, ‘roots’) )); } else … Read more
I had a pre_get_posts. What I missed was this: && $wp_query->is_main_query() This prevents the pre_get_posts to run on the menu query. Full code add_action(“pre_get_posts”, “custom_front_page”); function custom_front_page( $wp_query ){ if( is_admin() ) { return; } if( is_front_page() && $wp_query->is_main_query() ) { $wp_query->set(‘post_type’, ‘produkt’); $wp_query->set(‘page_id’, ”); $wp_query->is_page = 0; $wp_query->is_singular = 0; $wp_query->is_post_type_archive = 1; $wp_query->is_archive … Read more