Display all post types together

For the first part of your question, a pre_get_posts hook is all you would need. This code should work, providing you are using the default “Latest Posts” setting as your front page (Settings > Reading). add_action( ‘pre_get_posts’, ‘se132019_home_page_all_post_types’ ); function se132019_home_page_all_post_types( $query ) { if ( ! is_admin() $query->is_main_query() && $query->is_posts_page() ) { $query->set( ‘post_type’, … Read more

how to register / add multiple options into one field in wordpress?

Just set the name attribute in your checkbox tag in the format like: favourite_colors[]. The following code is derived from this thread. add_settings_field( ‘favourite-colors’, ‘Select your favourite colour’, ‘favourite_colors_checkbox_callback’, ‘my-settings’ ); function favourite_colors_checkbox_callback() { $options = get_option( ‘favourite_colors’ ); $html=”<input type=”checkbox” id=”red” name=”favourite_colors[red]” value=”1″” . checked( 1, $options[‘red’], false ) . ‘/>’; $html .= ‘<label … Read more

Is there a way to add a function that will get run after a blog is created?

Have you tried the action ‘wpmu_new_blog’ . The docstring for the function ‘wpmu_create_blog’ says: This function runs when a user self-registers a new site as well as when a Super Admin creates a new site. Hook to ‘wpmu_new_blog’ for events that should affect all new sites. wpmu_new_blog is called with the following parameters: do_action( ‘wpmu_new_blog’, … Read more