A
A
Alexander Sinitsyn2015-11-18 13:46:52
WordPress
Alexander Sinitsyn, 2015-11-18 13:46:52

How to customize files from shortcodes in Wordpress?

I made a directory in the child theme, put the file there, changed it ... it doesn’t take it, it uses the old one.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Ksenia Mikhailova, 2015-11-18
@arizona

WP only overwrites files when they are included in the parent theme via get_stylesheet_directory(), and not via get_template_directory()
It might make more sense for shortcodes to unregister it and then re-register with your function.

remove_shortcode('shortcode');
add_shortcode('shortcode', 'child_theme_func');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question