using do_shortcode

Folowing on Milo’s comment, do_shortcode expects the parameter to be exactly as if it is a shortcode inserted as part of the content, therefor your attempt to quote avatar_upload is just wrong and it should be do_shortcode(‘[avatar_upload]’); In addition it is probably better to just avoid using do_shortcode and call the relevant official API, if … Read more

WordPress website loads more posts than expected

The theme is most likely altering the main query via the pre_get_posts hook, chaning the posts_per_page argument to -1 for all posts, or another higher number. You can search your theme folder for pre_get_posts to see all the times this hook is used. A better solution would be to install the Query Monitor. With this … Read more

Child theme’s stylesheet cannot load [closed]

In the event a child theme is being used, this function will return the child’s theme directory URI. Use get_template_directory_uri() to avoid being overridden by a child theme. use : get_stylesheet_directory_uri() Example code Here <?php function my_theme_enqueue_styles() { $parent_style=”parent-style”; // This is ‘twentyfifteen-style’ for the Twenty Fifteen theme. wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ ); wp_enqueue_style( … Read more

Remove specific plugins and themes from the Dashboard->Updates page [duplicate]

There are two hooks you can use: ‘site_transient_update_plugins’, and ‘site_transient_update_themes’. Plugins To disable update for ‘fpw-category-thumbnails’ plugin, put the following code in functions.php of your theme ( child theme ): function remove_plugin_updates($value) { unset($value->response[‘fpw-category-thumbnails/fpw-category-thumbnails.php’]); return $value; } add_filter(‘site_transient_update_plugins’, ‘remove_plugin_updates’); If you want to disable updates for all plugins, use the following code: function remove_plugin_updates($value) { … Read more

Separation of presentation and code – WordPress

TLDR; Separate your view and business logic, or don’t – WordPress doesn’t care either way. Additional template engines aren’t necessary. Start small developing with vanilla PHP & WordPress; just build something that works, then separate it’s view and business logic. Continue refactoring as you learn and the project grows. When you’re comfortable with theme and … Read more