How to remove the space before the ellipsis in excerpt?

WordPress adds a space when applying the excerpt_more filters. Filter the excerpt_more to change this correctly. https://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_more add_filter(‘excerpt_more’, ‘theme_name_filter_excerpt_more’); function theme_name_filter_excerpt_more() { return ‘…’; }

Is it possible to use add_filter in an included file in the child theme’s functions.php?

What you’re trying to do is possible. When including php files, use get_stylesheet_directory() in child themes and get_template_directory() in parent themes. E.g. require_once( get_stylesheet_directory() . ‘/inc/myfile.php’); get_stylesheet_directory_uri() and get_template_directory_uri() will return URLs. Those functions are useful when enqueuing public assets such as stylesheets and JavaScript. Also, setting allow_url_include to Off in your php.ini will provide … Read more

Protect get_query_var from manual input in url

When someone messes up an URL it’s typically not something to do anything about. If you look at any site’s log they receive tons of completely broken and malformed requests every day. You only have to care about one case — that URL parses properly and input data is valid and safe. Whenever request is … Read more

Overide Variable in Child Theme

To override the variable directly add the fucntion print_page_title in child theme functions.php this should work as the parent theme uses if(!function_exists(‘print_page_title’)) condition to check for the function, since child theme’s function.php is loaded first this is used instead of parent theme. Place the following code in your child-theme’s functions.php function print_page_title() { global $post; … Read more

how to change wp-admin url using function file

Please see this one https://wordpress.stackexchange.com/a/4799/64458 and before ask any question do some research first. And after that ask your question/prob with your working source/code. Hey I already mention it that before ask anything please do some homework by your self. That will help you to improve. here is your questions answer https://wordpress.stackexchange.com/a/78258/64458 , if you … Read more

Missing a text-domain esc_attr_e

Don’t know about the error but the strings that are being translated need to be constant strings, not dynamic values. if $l10n[‘no-image-selected’] is already translated then use esc_attr and not esc_attr_e

Shortcode to return single custom post based on post taxonomy

From your supplied info, it’s not all very clear to me. But as far as I’ve understood your problem, here’s my approach. Assuming we have the following shortcode that the user has put inside a normal post’s content and that this shortcode will pull information from your custom post type case_studies: [casestudy study_type=”mountain”] So firstly, … Read more

How to pass variables from one function to another or combine functions

There are 2 ways that would be the most simple. Do it with a function call. Make the variables global. The first would be done like so: function my_func() { $styles=”stuff”; second_func($styles); } function second_func($styles) { // do something with $styles var_dump($styles); } The second way would be done like so: // Set global variable … Read more