How to show the posts listing on dashboard or custom page in admin panel?

I want to show posts listing(almost like the default post listing page) on the dashboard page. And if that is not possible then maybe on a new page in the admin area.

Basically, I want to create a "My Desk" page for users where they can see some posts listed categorised by post meta. I’m fairly new to WordPress and can’t get an idea as to how this can be achieved.

Any help is appreciated, thank you!

Display related posts without a plugin

I’m trying to display the related posts using functions.php:

function posts_related($  related){ if (is_single()) { global $  post; // Build basic custom query arguments $  custom_query = new WP_Query( array(         'posts_per_page' => 8, // Number of related posts to display        'post__not_in' => array($  post->ID), // Ensure that the current post is not displayed        'orderby' => 'rand', // Randomize the results ));  // Run the loop and output data for the results if ( $  custom_query->have_posts() ) : while ( $  custom_query->have_posts() ) : $  custom_query->the_post();   if ( has_post_thumbnail()   ) {                   $  permalink = the_permalink();                  $  post_thumbnail = the_post_thumbnail('medium');                  $  title = the_title();                                         $  related .= '<a href="' . $  permalink .  '"><img src="' . $  post_thumbnail . '/></a>';                               }            $  related .=  '<a href="' .  $  permalink . '"><b>' . $  title . '</b></a>';      endwhile;   else :      $  related .= '<p>Nothing to show.</p>'; endif; // Reset postdata }          echo '<pre>'; var_dump( has_post_thumbnail() ); echo '</pre>';       return $  related;  }    //wp_reset_postdata();  add_filter( "the_content", "posts_related", 99 ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 100, 50, true ); 

But I’m not being able to handle the output properly. I need it to display below the post (single post).

How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?

On the Edit Screen in the WP Admin there is a meta box for WP’s built-in Category taxonomy. This meta box is built using post_categories_meta_box() (/wp-admin/includes/meta-boxes.php).

This meta box uses wp_popular_terms_checklist( $ tax_name ) and wp_terms_checklist( $ tax_name ) to output the actual categories (with checkboxes) within the meta box.

wp_terms_checklist() (wp-admin/includes/template.php) uses the Walker_Category_Checklist (/wp-admin/includes/class-walker-category.checklist) to build the categories/checkboxes.

Walker_Category_Checklist inherits from Walker (wp-includes/class-wp-walker.php) just like a number of other WP walkers (Walker_Nav_Menu, Walker_Comment, Walker_Category, etc.).

When extending the Walker_Nav_Menu we can hook into the wp_edit_nav_menu_walker filter and return our custom walker. Is there a way to do this with Walker_Category_Checklist?

===

Update 1:

I see in wp_terms_checklist() there is:

apply_filters( 'wp_terms_checklist_args', $ args, $ post_id );

I’m thinking that I can hook into this filter, change the walker argument to a custom walker and that this may do the trick?

How to display all posts in a category at the end of a single post?

The "work" page for my portfolio is simply all the posts in the "work" category. They are displayed as a thumbnail grid. Here.

<?php get_header(); ?>  <div class="grid work thumb-wrap clearfix"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post();?>                               <a class="thumb" href="<?php the_permalink(); ?>">             <img src="http://www.nathanspence.com/wp-content/uploads/<?php echo get_post_meta($  post->ID, 'thumb', true); ?>"/>             <div class="post-excerpt">                 <h2><?php echo get_the_title($  ID); ?></h2>                 <div class="sub-title"><?php echo get_post_meta($  post->ID, 'project-name', true); ?></div>             </div>               </a>                               <?php endwhile; ?>         <?php endif; ?>  </div><!--end of "thumb-wrap"-->  <div class="push"></div>      </div><!--end of "page-wrap"-->   <?php get_footer(); ?> 

I want to duplicate this at the end of each single post. Here.

<?php get_header(); ?>  <div class="page-content">  <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>   <article class="work post-content ready-to-column clearfix">                      <header class="post-header column-left">         <h1><?php echo get_the_title($  ID); ?></h1>         <h2><?php echo get_post_meta($  post->ID, 'project-name', true); ?></h2>         <div class="project-info"><?php echo get_post_meta($  post->ID, 'project-info', true); ?></div>                        </header>          <div class="column-right">     <?php the_content(); ?>                                   </div><!---end of "right-column flex-column"--->               </article>      <?php endwhile; else: ?>     <p>Sorry, this post does not exist</p> <?php endif; ?>          <div class="grid work thumb-wrap clearfix"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post();?>                               <a class="thumb" href="<?php the_permalink(); ?>">             <img src="http://www.nathanspence.com/wp-content/uploads/<?php echo get_post_meta($  post->ID, 'thumb', true); ?>"/>             <div class="post-excerpt">                 <h2><?php echo get_the_title($  ID); ?></h2>                 <div class="sub-title"><?php echo get_post_meta($  post->ID, 'project-name', true); ?></div>             </div>               </a>                               <?php endwhile; ?>         <?php endif; ?>  </div><!--end of "thumb-wrap"-->  <div class="push"></div>      </div><!--end of "page-wrap"-->   <?php get_footer(); ?>  

As you can see, simply pasting it in just shows the current posts thumbnail. Any idea how I can do this?

Submit new posts to current category

i’m trying to Submit new posts to current category. For example on a wordpress site i select the category "Cars" and i see all the posts that belong to category "Cars" as archive page. In this time the current category is "Cars". If i use a form plugin to insert at front end the title and the body of a new post, is it possible to assign the current category on the new post?

thanks for the support.

How to make AJAX Load More Posts on Scroll for custom theme and custom-post-type?

I am currently working on a project where I am coding a custom theme with custom-post-type called products. Now, I am coding archive-product.php and stuck at making an AJAX load more posts on scroll for that.

I saw and tried most of the options available on internet. Most of them are made for Twenty Thirteen or some theme. I expect a custom code specifically for custom post type and that works for my custom theme.

Is this possible way to do so? I just want a code so that I can get more posts on scroll.

Get Posts by Category, Tag , and CPT Taxonomy

How to print only those posts which have Category, Tag, CPT Taxonomy.

I have tried out with this code but nothing prints. To print posts I used SS [commonposts category="2" tag="3" taxonomy="company" tax_term="4" posts_per_page="5"]

function common_cats($  att){     $  args = array(     'post_type'=> 'post',     'category'    => ['category'],     'tag'    => ['tag'],     'taxonomy'    => ['taxonomy'],     'tax_term'    => ['tax_term'],     'posts_per_page' => ['posts_per_page']      );                 $  the_query = new WP_Query( $  args );    if($  the_query->have_posts() ) :      while ( $  the_query->have_posts() ) :       $  the_query->the_post();        $  output .= "<a href=".get_permalink().">.the_title().</a>";   endwhile;      wp_reset_postdata();  else:  endif; } add_shortcode('commonposts', 'common_cats'); 

Appreciate everybody’s effort.

Automatically add Link Images to Posts in WordPress if has not linked before or has specified class

I use this code to Automatically add Link Images to Posts in WordPress.

function wpguy_linked_image($  content){ if (is_single() === TRUE){ $  searchfor = '/(<img[^>]*\/>)/';   $  replacewith = '<a target="_blank" href="'.get_permalink().'">$  1</a>'; { $  content = preg_replace($  searchfor, $  replacewith, $  content); } } return $  content; } add_filter('the_content', 'wpguy_linked_image'); 

How can I add a condition that if the img tags are already linked or have class="no link me" , they will be excluded from linking?