Show post titles only on the homepage

If the posts are already shown on your page, just with a bunch of unnecessary text that you want to take away, do the following: 1. Open the template file of your homepage (it can be named different in different themes, so impossible to give you the exact name of file, but usually they are … Read more

Hide parts of the post content on the home page

If your video is pasted into the post body, you have a couple of options. Use a filter on the_content and preg_replace to remove the content. Wrap your content in a shortcode. I am going to recommend option #2 because option #1 involves processing markup with regex which is tricky and prone to error, and … Read more

Dynamic homepage according to user role

To use a different page’s content on the homepage based on a logged-in user’s role you can do this: In your functions.php file add this code: function wpse_273872_pre_get_posts( $query ) { if ( $query->is_main_query() && is_user_logged_in() ) { //work-around for using is_front_page() in pre_get_posts //known bug in WP tracked by https://core.trac.wordpress.org/ticket/21790 $front_page_id = get_option(‘page_on_front’); $current_page_id … Read more

Random and Erroneous WordPress Redirect

If the redirect comes from WordPress code, you can find out who is calling wp_redirect() by hooking into it: add_filter( ‘wp_redirect’, ‘wpse12721_wp_redirect’ ); function wpse12721_wp_redirect( $location ) { // Get a backtrace of who called us debug_print_backtrace(); // Cancel the redirect return false; }

How can I specify a category post on my home page

You really should be using custom posts to do what you’re trying to do, but to answer your question here’s a solution (put this in your functions.php file): add_shortcode( ‘job-posts’, ‘rt_list_posts_by_category’ ); function rt_list_posts_by_category($atts) { $a = shortcode_atts( array( ‘link1’ => ‘#’, ‘link2’ => ‘#’, ‘link3’ => ‘#’, ), $atts ); // arguments for function … Read more