Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [posts]

Posts are the core of WordPress. They store content, are categorized, and are expansible with meta. Posts are grouped by post type, and within their post type by taxonomy (though a taxonomy can span more than one post type).

Filter by
Sorted by
Tagged with
0 votes
2 answers
16 views

Is there a way to add the list of recent posts into the admin sub menu on hover?

If I need to edit a specific post then I need to click the "All Posts" link and then find it. It would be nice to click directly on a link from within the popup hover sub menu. Something ...
user avatar
0 votes
0 answers
11 views

Bulk update published posts date randomly using wp-cli?

I see an option ([--post_date=<post_date>]) in wp-cli, but how can we use wp-cli to update all my published posts date randomly? For example, I want all posts date changed randomly between 01-01-...
user avatar
  • 1
0 votes
1 answer
16 views

Is there a way to make [Table Of Content] plugin while not using revision data?

I have a problem while using TOC plugins 'cause all of TOC plugins use revision data to recognize header tag. I'm using my own metadata (custum field) plugin and the data doens't show on the revision ...
user avatar
0 votes
0 answers
10 views

Adding /blog in front of single posts (only)

I would like to add /blog in front of the url for a single post: e.g. website.com/blog/news-article -> single article website.com/blog -> blog archive (showing a list of all blogs etc.) Ive ...
user avatar
1 vote
1 answer
24 views

Getting category posts from a certain year

Is there a way to get category posts from a certain year? I know how to get all posts posted in a certain year -> www.example.com/**year**/ or with months -> wwx.example.com/year/month (that's ...
user avatar
  • 11
0 votes
0 answers
30 views

WP query taxonomy optimization

Is there any way to speed this query? Noob here. SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND (...
user avatar
0 votes
0 answers
29 views

Creating posts with links from a txt file

I have a script which scrapes articles from the web and saves the url to a .txt file. I've created a custom plugin which on activation, loops through the urls and creates a draft post with the content ...
user avatar
0 votes
1 answer
17 views

Add static text to post URLs

I have 2 pages on my site which include blog posts (real site is pw protected): https://example.com/blog/ https://example.com/news/ All blog and news articles should have a URL that begins with https:/...
user avatar
0 votes
1 answer
9 views

ACF to select posts not displaying on blog page

I am trying to implement a repeater / post object so I can select posts that I want to displaying on the sidebar. I am using this code: <?php while ( have_rows('top_posts_repeater')) : the_row(); /...
user avatar
0 votes
0 answers
18 views

Choose whether to automatically add a taxonomy with the same name as the post

I created a custom taxonomy within the blog post. It's called "FootNotes." I would like there to be a checkmark inside in the creation of the post that asks me "Are there any notes ...
user avatar
0 votes
1 answer
27 views

Get all comments of author's posts

Hello I have multi author website. I want to display all comments of posts created by author in author page. Please help me. I found this code but fatal error <?php $args = array( '...
user avatar
0 votes
0 answers
25 views

redirect after submiting post for review

I have a frontend page that allows "Tutor Instructor" role, to create a course and this course is a custom type post called courses, when the Tutor Instructor finishes creating the course he ...
user avatar
  • 3
0 votes
0 answers
23 views

Display a specific category in a focused area of my site

I've been trying to change the code of my WordPress site. Rather than showing "trending posts" which is determined by post_views_count, I simply want to show posts from a certain category. ...
user avatar
  • 1
0 votes
1 answer
46 views

How to disable edit post option? [closed]

I have a WordPress LMS site, and the Tutor Instructor role can create posts as courses and these posts are custom post types called courses, and I want to disallow the Tutor Instructor to edit their ...
user avatar
  • 3
0 votes
0 answers
15 views

Post in bulk based on category template

Let's start with an example of what I want to do. take a look at hardreset.info / devicesfaq.com as you can see, the articles are almost the same, they only change few keywords / or based on title (...
user avatar
0 votes
0 answers
23 views

Pagination at category doesnt work with same name of page

i have a problem with my pagination but only at category page. I'am not developer, and i try fix it from few days. My pagination working if i make different name of pages for main BLOG, and category ...
user avatar
0 votes
1 answer
20 views

can't modify post title using the_posts filter

I tried to modify post title and content, content is modified in output, but title stays intact: function filter_the_posts( $array , $oQuery) { ... $array[0]->post_title='new title'; $...
user avatar
0 votes
1 answer
25 views

Prevent posts with certain post_meta to be edited

So I am looking at adding some custom post_meta to posts and I want those posts to not be editable, which will be some content that I am pulling in. Here is what I have: I have solved the issues when ...
user avatar
  • 1
1 vote
1 answer
38 views

Exclude post_meta from Rest API Endpoint

So I know that I can call: $response = wp_remote_get( 'https://www.example.com/wp-json/wp/v2/posts' ); To get all the posts from a specific website using the Rest API Endpoint. I also know that ...
user avatar
  • 15
0 votes
0 answers
24 views

Add posts to custom table in database instead of wp_posts

What the code does: Imports posts, loops through all the posts and calls wp_insert_post to create a new posts for each import. Objective: Import posts and store them in another table, not under the ...
user avatar
  • 177
1 vote
1 answer
31 views

Exclude posts w/ specific post_meta on Rest API endpoint

So WordPress offers the default Rest API endpoint, which is: https://example.com/wp-json/wp/v2/posts which pulls in all the posts. Is there a way to configure and modify the existing /wp/v2/posts ...
user avatar
  • 11
0 votes
0 answers
34 views

WordPress Rest API - Get all posts based on post_meta on custom endpoint

So I can't seem to figure out how to get ALL posts based on a specific post meta, so I wanted to reach out and see if someone might be able to assist. What I am trying to achieve: I have website A, ...
user avatar
  • 177
0 votes
1 answer
31 views

Admin slow on Postlist (over 30k Posts in Database)

we have a Site with around 20k Posts in the normal postlist and another 10k in other CPT. The custom post types work really fast, but the normal Post List doesn't. I assume that might be because the ...
user avatar
0 votes
0 answers
12 views

How to prevent to create same url of post, if the previous was deleted?

Let's say I'm creating a post, it's URL will be: www.example.com/posts/test-article so far so good. Then, I delete it and also remove from trash bin. Again, I create with the same title, and the URL ...
user avatar
0 votes
0 answers
43 views

Delete Post but retain image of post [WP REST API]

Currently, when I delete a post in my wordpress website, the image is deleted automatically. Which is fine for most cases, however, there are certain posts where I don't want to delete the image from ...
user avatar
0 votes
0 answers
20 views

Pull in posts using post meta for REST API

So I wasn't able to find much detail about this, so I wanted to ask the community to see if I can get an answer. So let's say that I have the following: $this->global_endpoint = 'https://example....
user avatar
  • 1
0 votes
0 answers
6 views

Mailing list submission from a post that doesn't have a form on it

I've received a mailing list submission from a blog post page on my WP site which doesn't currently show any forms. Any ideas how this could have happened? When I log in to the WP admin, go to Forms, ...
user avatar
  • 101
0 votes
1 answer
27 views

How Do I Redirect Wordpress Pages but not posts?

I have a client that changed jobs. He wants to redirect all pages on the wordpress site to a specific page on that site. But he also wants to keep all the SEO from the blog posts. So I need all the ...
user avatar
0 votes
1 answer
24 views

Automatically add images to a menu

I am calling a menu into a page, but I want to add images next to the title of the menu items. I have this code: <ol> <?php $navMenu = wp_get_nav_menu_items(2096); /*/Pass Nav Menu_id or ...
user avatar
  • 165
0 votes
0 answers
7 views

Show Last Revision Of Post That Has A Published Status On Single Page

I used this code to make a custom post status which is public so that the post is still available for people to view. // Define new awaiting status function my_custom_post_status(){ ...
user avatar
  • 145
1 vote
0 answers
23 views

Block Editor: Reset Reusable Blocks to last saved record

I’m trying to build my own Block Editor and I would like to reset all blocks to their last saved state by dismissing all unsaved changes when switching from Edit Mode to Preview Mode without reloading ...
user avatar
  • 11
0 votes
0 answers
49 views

Override WordPress core post-template.php block template

I need to modify the default markup generated using the render_block_core_post_template function located inside wp-includes > blocks > post-template.php. I don't see any other way of modifying ...
user avatar
0 votes
0 answers
15 views

How to select a category automatically based on a word in WordPress post title?

I am working with an auto-posting blog where the articles come through RSS Feed. There are lots of posts publishing every day automatically. Now I need to get a category automatically based on a word ...
user avatar
0 votes
1 answer
21 views

using is_paged for hiding image on posts

In my posts I'm using <!--nextpage--> in order to paginate specific blog posts, which works fine. But my issue is that the featured image shows in the post header for each page. I've tried using ...
user avatar
  • 113
0 votes
1 answer
14 views

Only show featured image on first page of paginated posts

I'm experimenting with paginated posts on my site using the SmartMag theme, and I've customized my post content template quite a bit. However, I still have one issue I'd like to fix: On paginated ...
user avatar
  • 113
0 votes
1 answer
16 views

Create a custom posts page

I've created a template that shows all my blog posts. But the issue was that this page slug (tips-and-tricks) wasn't added to the URL of the single post. Solution: I've selected this page as my blog ...
user avatar
  • 125
0 votes
1 answer
18 views

Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)

I installed latest XAMPP & extracted latest WordPress to this path: C:\xampp\htdocs I activated default theme: Active: Twenty Twenty I created these: 1 Page called test: http://localhost:82/...
user avatar
0 votes
0 answers
7 views

How to remove the ManageBlocksMenuItem in the ToolsMoreMenuGroup in the Gutenberg Editor?

In the Edit Article page of the Gutenberg Editor, click the three buttons on the far right side of the Gutenberg menu bar. You get an overlay with VIEW, EDITOR, PLUGINS, and TOOLS sections. Block ...
user avatar
  • 1
0 votes
1 answer
27 views

Why is a wp function used in current PHP namespace's callback not resolved to global scope?

Imagine the following script: <?php namespace MySpace; class MyClass { public static function execute() { // Do something post_exists(1,'','','my_post_type'); } } ?> I'm now ...
user avatar
  • 286
0 votes
1 answer
29 views

Exclude some categories from listing on the current post

this should be simple, but it seems it is not. I simply want to not list some of the current post's categories, just exclude them from the list of categories the current post belongs to I use this for ...
user avatar
  • 165
0 votes
0 answers
22 views

get value from get_post_meta then reuse it in another get_post_meta

I am writing the following code, which I have updated since the original question so as to give the entire picture. I am a newbie, and the reason why I am not using the get_posts() function in ...
user avatar
0 votes
0 answers
12 views

How to make ajax load posts from the current category?

I have a function which loads in posts by click, however on category pages /category/**** when using that button it should only load posts for the same category. I can't seem to get it to work and not ...
user avatar
  • 13
0 votes
0 answers
18 views

Wordpress - When visiting a `single post/ single.php` my category menu item link becomes active

I'm new to WordPress. So, I'm not really sure if it's normal behavior or not but this is bothering me. So, I've my main navigation menu consists of Home | category_1 | Category_2 | Category_3 ... The ...
user avatar
  • 101
-1 votes
1 answer
12 views

How do you order posts by type then term_id and then by date?

I am a php newbie and struggling to try and figure this one out. I have page where I am returning all the newsroom posts. The posts have a newsroom type that further divides them into Awards, Press ...
user avatar
  • 1
0 votes
2 answers
19 views

Different background colors for posts with Wordpress

I have a question. Right now I displayed my posts in the next way: Title and under it a short description of that post(everything centered and the post is looking like a card). My client wants each ...
user avatar
0 votes
1 answer
14 views

Get other posts sharing the same meta values

I want to get all posts having the same meta values. My Post A has 2 meta values: ID 182 and ID 183 I want to have all post having meta 182 or 183, excepting the current one of course. I have tried: $...
user avatar
1 vote
0 answers
25 views

WP Remote Request not returning all of content via request

EDIT: I think I discovered the issue, the endpoint is truncating the content response, does anyone know how to send over all of the data without it being truncated? So I stumbled across some ...
user avatar
  • 21
0 votes
1 answer
26 views

How can I restore posts from 'trash' with their previous post_status? - Wordpress

I have a Custom post type in wordpress in which when creating a new post 3 child subposts are created automatically. For example, I create the post and assign it some status 'Publish', 'pending', '...
user avatar
0 votes
0 answers
50 views

Rest API Paginate until all posts are imported

So I wanted to see if someone might be able to help me with this, so below I will explain what I've done: I am using wp_remote_get to grab the posts from another website with the arguments page and ...
user avatar
  • 21
0 votes
0 answers
10 views

why my urdu text is not aligned properly when written in wordpress blog post?

I was trying to write a blog post in urdu but the text got disorganized in the front end and also sentences were disorganized giving no meaning. I have installed a plugin for urdu font thinking that ...
user avatar

1
2 3 4 5
118