How can I see what template parts are being called for rendering the viewable page?

You can view the template part by using get_template_part($slug) It’s one of those hidden gems inside of WordPress that don’t get the attention they deserve. The get_template_part function is essentially a PHP include or require, on steroids: It already knows where your theme is located and it will look for the requested file in that … Read more

How to access certain WP functions inside custom class, in theme folder

You’re actually calling the add_meta_box() function before it’s defined, when you run this directly: \ci\wp\Metaboxes::addMetabox( ‘front_page_slide_settings’, ‘Slide settings’, ‘page’, ‘normal’, ‘high’ ); You don’t mention where you run it, but it’s too early or you run it in the front-end, where add_meta_box() is not defined. The add_meta_box() function is defined within this file: /** WordPress … Read more

The seventh parameter passed to add_submenu_page()

I was able to track this down to the culprit function add_theme_page(). There There was an additional parameter, per the codex for add_theme_page() that needed to be removed. Removing that seemed to help. function fivehundred_register_admin_menu() { add_theme_page( ‘500 Settings’, ‘500 Settings’, ‘manage_options’, ‘theme-settings’, ‘fivehundred_admin_menu’, plugins_url( ‘/ignitiondeck/images/ignitiondeck-menu.png’ ) ); } add_action( ‘admin_menu’, ‘fivehundred_register_admin_menu’ ); Fixed code … Read more

How to determine if a category is empty?

The get_term() function accepts a term id and a taxonomy slug. It returns an object that contains a “count” for that term. $obj_term = get_term(123, ‘your-taxonomy-slug’); echo $term->count; I’m not aware of any utility function that just counts posts in a particular category.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)