Add Function For Instances of Custom Text in Multiple Category IDs to display in post content

This doesn’t actually look like a WordPress problem, but rather a lack of PHP skills unfortunately. Your problem lies in this piece of code $custom_category_text=”<p> ” . $office[$office_random[0]] . ‘ ‘ . $office1[$office1_random[0]] . ‘</p>’; // Category ID = 1 if (in_category(‘1’)) { $content = $content . $custom_category_text; } return $content; $custom_category_text=”<p> ” . $home[$home_random[0]] … Read more

Function not recognizing page id?

missing “else” in the 3rd elseif. <?php /* Which logo do we use? */ if (is_tree(’33’) ) { // if is conway $logoClass=”logo-conway “; $link = get_bloginfo(‘url’) . ‘/conway’; } elseif (is_tree(35) ) { // if is cullowhee $logoClass=”logo-cullowhee “; $link = get_bloginfo(‘url’) . ‘/cullowhee’; } elseif (is_tree(31) ) { // if is Johnson City … Read more

Function to get the name in database table from the comma separated string

Not tested but this should work: add_action(‘manage_pages_custom_column’, ‘display_page_custom_cols’, 10, 2); function display_page_custom_cols($col_name, $post_id) { global $wpdb; $user_group = $wpdb->get_results(“SELECT * From custom_user_group”,OBJECT_K); if (‘user_group’ == $col_name) { $pages = explode(‘,’,get_post($post_id)); $output = array(); foreach ($pages as $page ) { $output[] = $user_group[$page]->GroupName; } echo implode(‘,’,$output); } }

Adding a filter with custom function to the menu / navigation

I’m not sure how you’re settings up your menus but this is probably the most reliable method. function auto_custom_type_class( $classes, $item ) { $type = get_post_type( $item->object_id ); if( $type == “marke” && has_term( “laden-1”, “laden”, $item->object_id ) ) { $classes []= “laden-1”; } return $classes; } add_filter(‘nav_menu_css_class’, ‘auto_custom_type_class’, 10, 2 ); The problem with … Read more