Child page menu in sidebar

When trying to output a function’s content, you have to notice whether you want to pass the data to another function (or something else which you want to feed), or you want to directly print it to the browser. If you use return, your function will return the data, so you can use them in … Read more

Functions in custom theme

Using functions.php Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.) In that way, the functions.php of a child theme provides a smart, trouble-free method of modifying the functionality … Read more

Can’t get buddypress notifications in front-end; why do I get this error?

use this: if ( !function_exists( ‘bp_core_get_notifications_for_user’ ) ) { require_once ‘/wp-content/plugins/buddypress/bp-core/deprecated/1.9.php’; } function cg_current_user_notification_count() { $notifications = bp_core_get_notifications_for_user(bp_loggedin_user_id(), ‘object’); $count = !empty($notifications) ? count($notifications) : 0; echo $count;}