Articles of posts

List all posts, pages and custom post types in admin

I want to create a drop down in my WordPress admin containing all posts, pages and custom post types. The return value should be a link to that page or an ID of the page. Is there something build in for this, or is there an easy way to do it? Thanks in forward.

Add simple field column to the posts screen

I know that manage_posts_columns is the hook for managing the column in post screen. I can add a column with following code, // add new column hook add_filter(‘manage_posts_columns’, ‘add_new_column_in_posts’); function add_new_column_in_posts($columns) { $columns[‘premium’] = ‘Premium’; return $columns; } My question is, how can I feed the simple_field value for that column?

$wpdb returns duplicate posts

I have created a shortcode which shows the posts which were created after the user last logged in. The shortcode is working perfectly fine, but I am not sure why but I am getting 7 duplicate posts. So like for test I created a post named as “Sample Article”, and when I echo out the […]

How to get all inline images in post content?

This question already has an answer here: Extract image src from a post and send it to an external form 2 answers

get current post id inside hook

I have created this hook to send notification only when new post is published. In notification I am sending link and title of post which is newly created. For that, I need current post id inside function. How can I get it ? add_action( ‘new_to_publish’, ‘send_notification’, 1 ); function send_notification(){ $post_data[‘ID’] = the_ID(); $post_id = […]

I would like to remove date display on photo preview

I have a web site and in the image preview of the posts, when I display images, there is a date displayed by the website and I would like to remove it. I’ve looked in the wordpress config but I haven’t found anything so I think I have to take a look at the code […]

How can I fix a slow redirect after form submit from frontend (no plugin)?

Below is the code I’m using for my short-coded form and to add the post. Here’s a basic overview of the problem I’m trying to remedy: -This form is displayed on the page at /addmember/ -On this page is also a list of existing members, current and pending (members being a custom post type) -This […]

Display a post via template

I want to display a single post in the sidebar-area (not the sidebar itself) and can’t seem to get it working. I know the post_id (it’s 1571 btw), so I looked around and only found this link from 7 years ago: Display Posts from a specific Category in the Sidebar So after looking around, I […]

How to query Posts from a custom post type which contains a custom taxonomy?

I have the following: $queryResponse = new \WP_Query(array( ‘post_type’ => ‘portfolio’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘portfolio_date’, ‘field’ => ‘name’, ‘term’ => $dateSelected ) ) )); var_dump($queryResponse); $dateSelected is ‘2015’. I want: All posts from post type of portfolio with a custom taxonomy of portfolio_date (Actual name: Portfolio Date. This is what the user […]

Post deleted in trash

I need a plugin or some method to recover deleted post of trash.