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).
6,038
questions
0
votes
0
answers
10
views
How Do I Make a Specific Post Sticky as Number Four in the List of Latest Posts on my Blog Homepage?
Currently, my WordPress blog displays a list of latest posts on its homepage. They are ordered by date with the latest post being at the top of the list. Is there a filter or a function that I can add ...
0
votes
2
answers
10
views
Category Attachment Pagination 404 Error on 2nd Page
I'm customizing category.php to display all attachments with a specific category, but when I click on a link for a page besides the first one, I get a 404 error. To reproduce:
Install a new Wordpress ...
0
votes
1
answer
21
views
Implementing Soft Delete for Bulk Actions / Empty Trash
I successfully introduced the concept of soft deletion for a custom post type by implementing an additional post_status named deleted. Whenever I click on a «Delete permanentely» link in the list, the ...
0
votes
0
answers
19
views
Can't save/get Patterns' `post_content` attribute
I am currently successful at getting the WordPress patterns via the following query:
SELECT * FROM {$wpdb->posts} WHERE post_type = 'wp_block'
Problem is, I realized post_content is empty, except ...
0
votes
0
answers
12
views
Exclude the Newest Recent Post from their Category After New post Publish old post should be in their category at Home Page
For Avoid Duplication of Posts
Exclude the (Recent Newest Post) from their Category. But when a new post is published again in a similar or another category, the old post should be included again in ...
1
vote
2
answers
62
views
Warning: Undefined variable $post_id
Hi can anyone please help.
I'm no computer buff and need a step-by-step guide if possible.
In getting this error on my product pages:
Warning: Undefined variable $post_id in /customers/5/f/d/...
0
votes
0
answers
20
views
How to extract and reveal code from SQL database in Wordpress
I have had to stop using a particular plugin (php everywhere) for security and no recent updates issues. However I would like to retrieve the code which was stored against that plugin which I have got ...
1
vote
1
answer
14
views
Preset category checkbox from URL parameter when creating new post
I have added custom "New Post" links to the admin menus and dashboard widgets in the admin panel to allow administrators/editors to post new content with the category preset when the editor ...
1
vote
1
answer
23
views
What is the best way to publish News articles?
I run a blog on affiliate marketing, SEO, and other topics and luckily got AdSense approved. Now, I want to start a News section on my site.
Should I add a News category and write posts or create a ...
2
votes
1
answer
13
views
Modify upload directory to use post category slug in file path on multisite installation
I am using the default post type and category taxonomy to manage the content on an in-development website that is using WordPress multisite. There are categories defined like "bylaws" and &...
0
votes
0
answers
12
views
Menu item on a category
I read your post on how to create a menu based on category, but it displays all the posts in their entirety instead of just get the title as a link.
I now have only some 12 posts in a category but ...
0
votes
0
answers
13
views
How to change layout of headers in 'latest posts'
Hope you can help me! I would like to change the headers of all blog posts in 'recent posts' so they stand out more. Currently it is difficult to discern one post from the other. If the font of the ...
0
votes
1
answer
45
views
How to display only the first 2 words of a post title
I am learning WP and want to display only the first two words of a post title to the user. For the end user only the first two words of the Post title (H1 class) should be shown but source should have ...
1
vote
1
answer
26
views
Why does 'get_the_ID' work outside of the loop?
on WordPress Developer Resources website's page related to get_the_ID() function it says:
Retrieves the ID of the current item in the WordPress Loop
But I can use it outside of the loop and it works ...
0
votes
0
answers
24
views
How to get ACF field to show up on all posts on front end?
I have thousands of posts with attached files. These attached files are part of Advanced Custom Fields Pro. However, they are not showing on the front end for the posts.
These files are utilizing the ...
0
votes
0
answers
17
views
Global update of records after import WP All Import Pro
friends. I have encountered a problem updating records.
I am importing vacancies into the WP Job Board Pro plugin via the WP All Import Pro plugin.
When importing, I have a field in wp_postmeta ...
0
votes
0
answers
22
views
I am having a problem with fetching product data in the Gutenberg block editor
const allProducts = useSelect((select) => {
return select('core').getEntityRecords('postType', 'product', {
per_page: -1,
_embed: true,
});
}, [...
0
votes
0
answers
20
views
WordPress Redierction
I would appreciate it if you could help me to sort out the below issue. I have created a blog using Custom Post-Type in WP. now all my blog links are showing as follows. how can I remove redirection ...
0
votes
0
answers
36
views
Blog Posts Work in Preview, But Are Not Visible on the Live Page - READ MORE u003cspan aria-hidden=’true’u003e→u003c/spanu003e Error
Returning to a WordPress site that I have been away from for a while, I discovered that my Posts show up fine in Preview, but the actual page displays "READ MORE u003cspan aria-hidden=’true’u003e→...
0
votes
0
answers
20
views
Images and menu links disapearing after saving
I am using Wp Bakery on a salient theme and have a bug where images or background images on 2 specific pages don't save or show once added.
This also appears on the menu widgets, I will add a custom ...
0
votes
1
answer
35
views
editPost without undo entry
I am updating my post status with following snippet:
dispatch("core/editor").editPost( {
status: 'draft'
} );
My problem is, that this action creates a new undo-entry. Is it possible ...
0
votes
2
answers
103
views
Custom permalink for 'post' not working
I want to set custom permalink for (standard) post and have url structure, like
site.com/guide/news/ - blog list (or archive) page
site.com/guide/news/post-name - for single post
My steps:
I have a ...
0
votes
1
answer
41
views
How to allow Contributors to edit their own posts, whilst still needing to be reviewed by an admin?
Im using the User Role Editor plugin to try to acheive this, but I've also tried PublishPress Capabilities and had the exact same problem.
I'd like it so that my contributor users work like so:
Their ...
0
votes
1
answer
46
views
I want the Title of page/post to show up topmost when reading the post/page
I want the Title of page/post (in content area) to show up topmost when reading the post/page.
If you use #anchor link you can only link to the topmost textblock, but then the Title of the post ...
0
votes
1
answer
28
views
Wordpress post meta key and value lookup
Correct me if im wrong but is this right when searching for poet meta key a value in Wordpress ?
$args = array(
'post_type' => 'clientorders',
'meta_query' => array(
array(
'key' =&...
0
votes
1
answer
50
views
What is the easiest way to create a custom field archive?
So, here is the issue:
I am using a plugin named User Submitted Posts, and it works great on its part. However, I still want to have that user content page the Twenty Twenty Four theme has by default, ...
0
votes
1
answer
89
views
Featured Image not displaying in elementor widget
I am working in elementor and I grabbed a featured image widget into the container but the image is not showing, kindly assist me. View attached image.
0
votes
1
answer
37
views
Is it safe to totally unregister the default "post" Post Type
I would like to start a fresh WordPress install and unregister the default "post" Post Type (and by unregister it, I mean totally wipe it out (database included)).
Is it a safe purpose ? And ...
0
votes
0
answers
21
views
Images being uploaded via WP Media are not attached even they are used by some CPT posts
I would like to delete thousands of images on my WP websites which are no longer used by some CTP posts which have been removed even from Trash folder.
However, I found out that Images being uploaded ...
0
votes
1
answer
30
views
How to display breadcrumb on category?
I have a breadcrumb displayed on all content types (pages, posts, homepage etc.) - beside of category. What is the way to add category to content types, where breadcrumb is showing?
This is the ...
0
votes
0
answers
15
views
Category and archive issue
Help, please.
I have 4 category pages. When I publish a post on a specific category page it shows on all category pages after creating an archive page.
But I want specific archive page for specific ...
0
votes
0
answers
45
views
Twenty Twenty-Four: Static Front Page with Post Links
The post links show nicely in the edit (using blog home template writer pattern):
wp-admin/site-editor.php?postType=wp_template&postId=twentytwentyfour%2F%2Ffront-page&canvas=edit
The post-...
0
votes
1
answer
33
views
Drawbacks of making the default post-type: post hierarchical [closed]
I want to know about all the drawbacks and consequences/errors I might face if I make the WordPress's default post-type: post, hierarchical. Is it recommended? I have a requirement where I need to ...
0
votes
0
answers
28
views
Allow users to edit post without logging in
I'm working on a site where non-logged in users are able to submit their posts. It's easy to do on front end, however, when the posts need to be edited, it's a completely different story.
So, is there ...
0
votes
1
answer
34
views
When inserting media file in a post or page, show file name under the thumbnail
When using insert media into a page it shows a grid of pictures. How can I change that to see file names instead (or both)? And would there be a way to have the images sort by file name?
1
vote
0
answers
38
views
Wordpress as microblog: show excerpt instead of "(no title)" in posts view
I am using WP (currently v6.5.3) for cross-posting to micro.blog/Mastodon/Bluesky (and occasionally manually posting the items to X or Threads).
As such, my posts rarely have titles, which makes it ...
0
votes
1
answer
35
views
How to get total posts count for each date?
function test_dashboard_content() {
$args = array( 'posts_per_page' => -1, 'post_type' => array( 'post', 'page' ),
'post_status' => 'publish', 'date_query' => array( 'after' => '...
0
votes
0
answers
97
views
Wordpress REST API - Create post not working with 401 response but list posts working
I have used miniOrange API Authentication plugin and configured JWT authentication -> JWT generation using HS256 Encryption.
I am able to fetch a token for a wordpress user (which is set as ...
1
vote
1
answer
44
views
Is it possible to create dynamic templates for block themes directly from the site editor?
For example, you can create a posts template within the site editor, but how do you make it so that the content for each respective single post displays dynamically?
Here's my single post template ...
0
votes
0
answers
16
views
WordPress current post functions inside loop doesn't work anymore, are they incompatible with php 8.0?
I recently update php from 7.4 to 8.0 , since many functions doesn't work anymore !
I don't know if it's related but I have tried many solutions and none of them works.
Using (get_...) , the_title, ...
1
vote
0
answers
17
views
How to add a post page from a button without reloading
I am a novice in developpement and I am trying to create a page. When I click on the button Gutemberg, it will generate a post page with a text and an image. The problem is that the page is created ...
0
votes
1
answer
42
views
Global $post value outside the loop
On a category archive page, in a filter called from a block outside a loop, I noticed that the get_post function with a null first parameter returns the first loop's post.
Is it supposed to return ...
0
votes
0
answers
31
views
Display posts based on the selected category when no subcategory is chosen
The following code displays posts based on subcategory. First dropdown is a custom taxonomy category, second dropdown narrows down the search to subcategories associated with selected category. My ...
1
vote
1
answer
67
views
Set Featured Image of a post
How to set Featured Image when creating post using
$post_id = wp_insert_post( $args ); ?
0
votes
1
answer
53
views
Modify Post URL Programmatically
I am creating post using wp_insert_post(). I would like to insert Post URL at that time. How can I do that ?
0
votes
1
answer
20
views
Insert Tag in WordPress Post
I have below code.
$args = array(
'post_title' => $this->h1,
'post_content' => $this->profile_text,
'post_status' => 'publish',
'post_type' => 'post',
'...
1
vote
0
answers
22
views
Custom group pattern layout is not showing in posts
I have created a group layout in one of my blog posts.
I can import that layout into any new blog post.
It shows perfectly in the editor option but doesn't show anything in the view page when I save ...
0
votes
0
answers
20
views
Post URL redirecting to homepage
Please I need help, i have added dynamic content using Pods - Custom Content Types and Fields
and the post url button is redirecting me to homepage instead of a single post page.
0
votes
0
answers
51
views
Code understanding
I found below code in a Plugin.
const sent_urls = () => {
const formData = new FormData();
formData.append('action', 'start_parsing');
formData.append('...
1
vote
0
answers
21
views
Is there a way to eliminate flyout menus when adding a post?
It seems like each new version of wordpress adds more intermediate menus and menu options than the previous. Particularly heinous examples include the Preview button with its form-factor checkboxes, ...