Combine multiple menus using the filter wp_nav_menu_items

Thankful to the Lord, I found a solution for anyone else that comes across this issue. I took this function from the WordPress codex and modified it to soot my needs function get_menu($menu_name) { $menu_items = wp_get_nav_menu_items($menu_name); $menu_list=””; $count = 0; $submenu = false; foreach( $menu_items as $menu_item ) { $link = $menu_item->url; $title = … Read more

Images with overlay

I was able to find some jQuery that helped solve the issue: $( “.alignright” ).parent().addClass( “alignright” ); $( “.alignleft” ).parent().addClass( “alignleft” ); $( “.aligncenter” ).parent().addClass( “aligncenter” ); This small piece of code finds alignright, alignleft, and aligncenter then adds those classes to the “parent” container, which is the containing element that those classes are applied … Read more

Insert Modal on user first login

The problem is that wp_login comes at the end of the wp_signon() function. But that’s not the end of things for logging a user in. After that, they are redirected (so that the auth cookie that is set during logon can be read). As a result, the user is wisked away to a new page … Read more

Calling hooks in functions

You’re on the right path with your add_filter, but this is the right way to implement filters. add_filter( ‘gigpress_related_post_types’, ‘my_related_post_types’ ); function my_related_post_types( $post_types ) { return array( ‘productions’ ); } The hook add_filter must call a function that returns something to pass to the apply_filters in the code you referenced. You should add in … Read more

Auto remove tags on certain date

You can use wp_schedule_event( int $timestamp, string $recurrence, string $hook, array $args = array() ) function to automatically remove the tag. This function will run automatically after the given interval. You can set the interval daily. Daily the function will run and remove the tag from the post if current date is equal to certain … Read more

Warning and fatal error

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘sanitize_comment_cookies’ not found or invalid function name in /homepages/9/d346623364/htdocs/wp-includes/class-wp-hook.php on line 286 This means you have a function named sanitize_comment_cookies hooked to an action or filter, either in your theme or a plugin, but that function is not available. Look for the code: add_action(‘some_action_name’, … Read more