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
0 answers
13 views

Hook save_post_cpt not triggered when custom fields are modified

Say I have created a custom post type named 'custom_post'. 'custom_post' contains three custom fields which are added using ACF: 'custom_field_a', 'custom_field_b' and 'custom_field_c', where '...
user avatar
0 votes
1 answer
14 views

wp_set_post_terms doesn't allow to manually add new terms [closed]

So I'm creating a function which based on the selected category for the post, it automatically adds terms (tags alike) to that post. It works fine, the problem is now the post has those terms and if I ...
user avatar
0 votes
0 answers
16 views

CSV import into Wordpress POST with Advanced Custom Fields (ACF) [closed]

I have tried: WP Ultimate CSV Importer FREE It actually works, can even assign category. However, only the PRO version (USD99) can be used to import ACF (Advance Custom Fields). I'ved got several ...
user avatar
  • 61
0 votes
0 answers
15 views

How to change the "main menu" of a "post"? [closed]

How to change the "main menu" of a "post"? Currently, my posts display a menu called "primary"; what if I created another menu called "primary-2" and wanted to ...
user avatar
0 votes
0 answers
18 views

Get post publishing date from within custom HTML block

I am using a custom HTML block to create a customized title cover for a post on my WordPress site. I would like to get the current post publication date (rather than hard-coding it in and having to ...
user avatar
0 votes
0 answers
47 views

Add text and change style to post programmatically depending on category

Can someone please let me know how to add text to posts depending on category and how to change the styling of a post depending on category ? I tried to add the function below to functions.php, but it ...
user avatar
0 votes
0 answers
10 views

Display hierarchical categories/sub-categories for a single post only

In a single post, I am wanting to display the hierarchical posts categories, with links to the child subcategories only. For example, let's say a post is about the movie Star Wars - I would like to ...
user avatar
0 votes
1 answer
28 views

Wp Query : Order by distance lat,lon

I'm new to this forum, sorry in advance :) I have a problem with my display of my posts Let me explain ^^ I want to perform an orderby => '$distance' and display the posts accordingly. $lat2 and $...
user avatar
0 votes
0 answers
9 views

Change modified date to current date when title updated automatically

I use shortcode in title for everyday date (1 Aug 2022), so daily the title has been modified because of date change but modified date is not updated every time when title modified. How to update ...
user avatar
0 votes
0 answers
6 views

Set Default Post as Parent Child (Nested) Relation

I want to select post as parent for child posts for default post type not custom post type. By default wordpress allow nested relation only for pages but i want for posts. Anyone have idea how to ...
user avatar
0 votes
0 answers
10 views

Is it possible to modify posts table to only read for more recent ones?

I have a news site built with WP. Everyday about 100 new posts are published. As a result, at the end of the month there can be as many as 3000 new posts in the posts table. Consequently, by the end ...
user avatar
0 votes
1 answer
9 views

Separate blog and reviews categories

I created a review website recently where I write website and product reviews.I intend to write blog posts too on my website. I don't want to create subdomain or separate blog page.Both review posts ...
user avatar
0 votes
0 answers
18 views

Update existing post dates to random dates and time

I found this solution but it's now not working now (I am getting a fatal error), can anyone please update the code so its works with WordPress 6.1 (Original Post: Update existing post dates to random ...
user avatar
  • 1
1 vote
1 answer
30 views

Plugin custom post template; without overriding all posts

I've created a plugin and I am trying to include an post template that the user can optionally use. I've tried the following, add_filter( 'template_include', 'insert_my_template' ); function ...
user avatar
0 votes
1 answer
24 views

Custom Posttype URL

I create custom post type code is below function jobs_post_type() { $labels = array( 'name' => _x( 'Jobs', 'Post Type General Name', 'OceanWP' ), '...
user avatar
0 votes
1 answer
27 views

Filter out posts based on a certain post_meta on the WordPress REST API

So I'm going to explain this the best way possible, and see if someone might be able to help me out. Website 1 (Posts located here): Let's say that our WordPress REST API endpoint is: https://example-...
user avatar
  • 13
0 votes
1 answer
22 views

Creating a redirect option for current page url

I am running a multisite network with around 8 websites. Currently, some sites have more content than others(for example, mysite.com/uk and mysite.com/dk have more posts). What I am trying to achieve ...
user avatar
0 votes
0 answers
18 views

How to associate a custom taxonomy to a post multiple times

On my Posts, I'm trying to associate a custom taxonomy to it multiple times. The example is that I have a User taxonomy and a Post which is like an event. I want to be able to associate the User ...
user avatar
  • 1
0 votes
0 answers
17 views

Woocommerce Custom Meta Boxes- How to only display if they actually have content

I've managed to add two custom meta fields to the backend of woocommerce, shipping and size guides, using the add_meta_boxes function, as I don't want to use the woocommerce custom fields section as ...
user avatar
0 votes
0 answers
25 views

Return records between two meta datetimes saved as strings

I have a start date and an end date saved as post meta fields (so strings). I want to return posts between two date ranges. I thought it would be a simple string comparison - one datetime represented ...
user avatar
  • 1
0 votes
0 answers
24 views

Post date automatically +100 years into the future

Thank you for taking time to read my questions as I understand the request is a bit odd. Currently I am doing posts in the Sci-Fi genre and would like the posts to come out reading 2122 instead of ...
user avatar
  • 1
0 votes
1 answer
15 views

Display Current Posts Category (with the most posts)?

I have an post article, with a title date and the category the post is assigned to. The post is in multiple categories, but i only want to show the 'main' one its in and none of the others (for now). ...
user avatar
  • 197
0 votes
0 answers
14 views

Display custom post front end filter by ACF equals current user

Let me try to be as clear as possible : I would like to display my custom post on Front-end. I made a Back-office for a mobile app, but I'd like to create an access from front-end to display some ...
user avatar
1 vote
1 answer
54 views

WordPress notification if new post published

I use WordPress and I want to alert users if new post with post_type = job_post was published. Also I want to show amount of new post. So I add to function.php global $new_job_count = 0; function ...
user avatar
0 votes
0 answers
36 views

How can I add random alphabets in wordpress permalink posts structure

I want to add random alphabets to wordpress posts permalinks with the following order: current permalink structure sitename.com/view/%postname%/ https://www.sitename.com/view/this-is-my-post-title/ to ...
user avatar
0 votes
0 answers
12 views

Moving featured image to top of new post editor screen

For some reason I'm having a hard time finding the right file to edit (even though I've done it before) but I want to move the featured image section to the top of the sidebar for the 'new post' ...
user avatar
  • 113
0 votes
0 answers
67 views

How to display the post categories for each post inside the loop with custom format?

I'm trying to create a shortcode to display the post categories with custom format (ex.: I need to display emoji acf field before each category). I'm using version 6.0 of WordPress and the Full Site ...
user avatar
0 votes
1 answer
46 views

What snippet do I need to type to show my ACF field show up on my theme?

I've been trying all kinds of things but I can't get it to work cuz my Theme single.php looks different that usual. I made a field in ACF named Region and then enter for example USA which I need to ...
user avatar
0 votes
0 answers
28 views

Allow / show post comments in category pages

Is there any way to allow the users of a website to write comments (and also see the already published comments) on one post when it's displayed in a category page? I'm not looking to let the category ...
user avatar
  • 1
0 votes
0 answers
8 views

AWS usage queries

1.We are hosting multiple Wordpress websites on Aurora database. We develop the sites in a subdomain and when go live we just rename the subdomain to the actual domain and make the necessary changes ...
user avatar
1 vote
0 answers
51 views

Wordpress programatically inserted post not showing in authors profile

I have inserted a post programmatically in a wordpress When viewing the post on the authors' page, there is no post from the post that I have inserted programmatically, but when manually updating the ...
user avatar
0 votes
1 answer
20 views

Wordpress bulk category select when publishing post

Often I need to attach post to all categories and I have about 200 categories. When I need to select all categories while publishing post , I select categories one by one. How can I add select all ...
user avatar
0 votes
0 answers
19 views

remove specificly the last <p> tag in all posts

How to remove the last line of content in all of my WordPress posts, which always have its own tag <p>...</p>? Ex: <p>content I want to keep</p> <p>line I want ...
user avatar
1 vote
1 answer
37 views

Whitelist Author of Private Post

Does anyone know of a way to whitelist the author of a private post so they never have to enter their password to access their own post on the frontend? If they are logged into the site, there must be ...
user avatar
0 votes
0 answers
15 views

The WordPress wp_posts data table

We have a problem with our wp_posts table and are uncertain as to how to fix it. We recently migrated a site of about 13K users and about 5K posts. The apache log is collecting errors that read like ...
user avatar
1 vote
1 answer
35 views

Changing custom type name hides the posts [closed]

I created a custom post type. Plugin used is Custom Post Types & Custom Taxonomies plugin which does the job very good. And added some posts to it. But when I modify the name of the newly created ...
user avatar
0 votes
0 answers
20 views

Optimal WP Web App Backend for mobile app development

I'm having a web app built on wordpress, and am needing to build a mobile app with it. The probably most important aspect of this is that I'll need to transform all of my AJAX request-responses to the ...
user avatar
  • 359
0 votes
1 answer
17 views

Change permalinks for posts & for custom post types

I need to change blog post permalink to /post/post-title & I want to remove "custom-post-type" slug from the custom post type so that /custom-post-title will be shown. These two doesn't ...
user avatar
0 votes
1 answer
18 views

wp_insert_post_data: Limit number of Page but Post get affected

I want to limit Page creation to be 3, without interfering other post type like Post. I'm using below function: function set_post_to_draft_page_only( $data, $postarr ) { if($data['post_type'] == ...
user avatar
  • 191
0 votes
0 answers
11 views

Indenting within a blockquote

I’m trying to further indent text within blockquotes, but I’m not sure how to do that. It’s not letting me add bullet points or other forms of indentation. Specifically, I'd like the sentences ...
user avatar
0 votes
1 answer
54 views

Pagination in single.php

I have a problem with the pagination on a single.php page. The idea is to have a list of my created posts (the excert, the title and a link to the post) on the post page (single.php) that shares the ...
user avatar
  • 3
0 votes
0 answers
31 views

WP_Query get posts in custom database table [duplicate]

I have a custom database table like this: How can I get the 5 posts of custom post type whose ID appears most times? Thank you!
user avatar
0 votes
0 answers
16 views

How to save template data into wp_post table (post_content column)

Is there a way to save template data into wp_post table? I made a custom template that automatically makes tables and some sentences with the meta-data that users insert in. I wanted to make users ...
user avatar
0 votes
1 answer
24 views

How to Get Posts, Including Private Ones?

Currently in one of my php files, I retrieve all of the public posts like this: $posts = get_posts(array( 'posts_per_page' => -1, 'post_type' => 'post' )); However, this only returns ...
user avatar
0 votes
1 answer
57 views

Getting featured image with PHP and not javascript from wordpress api _embed [closed]

Not having access to the functions file, I can't add the function to add the featured image to the API so I need to use wp-json/wp/v2/posts?_embed. With javascript I believe it is ._embedded['wp:...
user avatar
0 votes
2 answers
23 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
20 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
17 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
20 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
26 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

1
2 3 4 5
118