prevent category page from also highlighting blog-page menu

Add this to your child theme’s functions.php: add_filter(‘nav_menu_css_class’, ‘fix_category_menu_active_class’, 10, 2); function fix_category_menu_active_class($classes, $item) { // If we’re on a category archive if (is_category()) { // Get the ID of the blog page (posts page) $blog_page_id = get_option(‘page_for_posts’); // If this menu item is the blog page if ($item->object_id == $blog_page_id) { // Remove the … Read more

_load_textdomain_just_in_time

$shortname=”atp”; add_action(‘after_setup_theme’, ‘atp_theme_setup’); define(‘PSTCTRL_DIR’, get_template_directory() . ‘/pest-control/’); if (!defined(‘PESTCONTROL_DIR’)) { define(‘PESTCONTROL_DIR’, get_template_directory() . ‘/pest-control/’); } // Modified theme initialization add_action(‘after_setup_theme’, function() { global $atp_theme, $url; if (defined(‘PESTCONTROL_DIR’) && file_exists(PESTCONTROL_DIR . ‘index.php’)) { require_once(PESTCONTROL_DIR . ‘index.php’); } else { $atp_theme = new ATP_Theme(); $url = FRAMEWORK_URI . ‘admin/images/’; } }, 5); if( !function_exists(‘atp_theme_setup’) ){ function atp_theme_setup(){ … Read more

How to display a function inside shortcode tags

I have modified the code… function myFunction() { $output=””; $entries = get_post_meta(get_the_ID(), ‘_kad_repeat_group’, true); if (is_countable($entries) && count($entries) > 0) : foreach ((array) $entries as $key => $entry) { $title = isset( $entry[‘_kad_title_ekstra’] ) ? esc_attr($entry[‘_kad_title_ekstra’]) : ”; $output .= ‘<h4>’.$title.'</h4>’; } endif; return $output; }

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