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
1answer
11 views

How to get a list of all the years that have posts

All I want is an array of years that posts exist from first to last but for some reason I'm only getting the first two years, 2019 and 2018, when I have posts going back to 2016. Here's my code: &...
0
votes
0answers
9 views

Order by meta_key field in Wordpress not meta_value field value

I have a requirement where I need to show all posts having thumbnail first and ordered by title and then remaining posts ordered by title Below is the code I tried $the_page = (get_query_var('paged'...
0
votes
1answer
11 views

Why doesn't wp_delete_post allow trashing for custom types?

When you're trying to wp_delete_post a custom post type, it deletes it fully instead of moving it to trash as it is the normal behavior. This happens because "force delete" is, by default false and ...
0
votes
1answer
22 views

a WordPress connected to 2 database

Is it possible that Wordpress works from two databases? I would like the post published by web A to be reflected on web B Web A would only affect the information in the tables wp_postmeta wp_posts ...
0
votes
1answer
18 views

“read more” redirects to the wrong page

I would appreciate it if someone can help me out. I am having issues with my blog posts. I had someone customize by site but they made a mistake with the blog posts. I am no longer working with them. ...
0
votes
1answer
7 views

What date to use as a post date? date_gmt or modified_date_gmt

I am consuming a rest service with the posts, and get both date_gmt and modified_date_gmt ... What realy is the difference ? Is the modified_date a publish date also? Any way, if I am presenting ...
0
votes
0answers
3 views

How to bulk update post publication dates and permalink structure?

So, we just recently got out site updated and the contractors didn't do a good job of transferring our content. Because of the differences in database fields, they copied all of our content, but the ...
0
votes
0answers
13 views

Diffrent layout for posts [duplicate]

I have two rows to display posts in first row i have two posts image + content , image + content And in second row the post layout change means content + image , content + image can you solve this my ...
0
votes
1answer
14 views

Adding parent pages to posts

I want to add a parent page to my blog posts so I can track their traffic together on Analytics. I want to avoid adding extra tracking code in the header to avoid slowing my site down. So what I want ...
0
votes
1answer
19 views

Settings missing from the add new post page

It has been a while since I used WordPress and it seems that lot have changed. It appears that I cannot see certain settings anymore, like set tags, set categories for a post, permalink and more. Can ...
-1
votes
1answer
33 views

loop 1: image + contents and image + content loop 2: content + image and content + image in wordpress how can i display my post according this [on hold]

<div class="main_blog_content"> <?php $arr = array( 'posts_per_page' => 4 );?> ...
0
votes
0answers
8 views

Add new user role and allow only edit “Tags” of posts

I would like to add a new Wordpress role and assign to it the permission to only edit Tags of Posts. How can I do it? PHP code or Plugins are welcomed. Thanks.
0
votes
0answers
13 views

Send POST request to Flask app from functions.php file

I have an endpoint on my Flask app that I can hit via Postman and it works fine. However, when I write the POST request in my functions.php file and trigger it via button press, my server returns a ...
0
votes
0answers
14 views

padding adjustment for pages and posts (left and right sides) [closed]

I have a question concerning the adjustment of the left and right padding for the content area of all of the pages and posts of my WordPress site. I would like to increase the padding on the left and ...
0
votes
0answers
8 views

Display current post position in Elementor Posts widget

I'm using Elementor 2.6.8 + Elementor Pro 2.6.2 I'm designing an Archive template to display a list of Custom Post Types filtered by custom taxonomy terms. I'm using Posts Widget from Elementor Pro ...
0
votes
0answers
10 views

Site search gets me to posts page

I've built a web shop, on my 404 page I've a search bar, if you search there for a products it redirects me to a page with all the posts, but i want it to redirect me to the product search page, or ...
0
votes
1answer
12 views

Updating failed [closed]

I cannot create or update any post or page on my site. I just installed WordPress, am still on the default theme with no plugins activated. Any odea what could cause this?
0
votes
0answers
9 views

Wordpress post to Mailchimp campaign: youtube video to image linked to the youtube video, not to the post [on hold]

I want to send posts from a wordpress site through Mailchimp's RSS campaign. Everything goes as expected, however, there is an issue: When a post has an embed youtube video, the video is embed to the ...
0
votes
1answer
27 views

WP posts using index.php instead of single.php

The posts on my custom theme are using the index.php file instead of single.php _ I have looked through at least 10 questions on SO_ although many of them are very old _ Some answers said that if ...
0
votes
1answer
9 views

Pagination (including title of each page) in a post for a long posts

I currently have pagination on my website for long posts. I have split the post into several pages. But it only displays the page number with navigation arrows, but not a title for each page in a ...
0
votes
0answers
33 views

How to increase the number posts that displays by a hierarchical taxonomy? (HTTP ERROR 500)

I got HTTP ERROR 500 when I tried to get all the posts from a hierarchical taxonomy which is category. I have a page and in this page I want to display all the posts. This page and those posts have ...
0
votes
2answers
11 views

Deleted page still shows and is showing posts archive

I have a weird issue. I deleted a page and permanently deleted in from the trash but I can still get to it. On the deleted page it shows the posts page ("Blog" page). I have cleared the permalinks, ...
0
votes
1answer
14 views

Display simple html code in post

Using Wordpress 5.2 and classic editor, I just want to display HTML code in my post. I use Prismatic as syntax highlighter. In my post, in the "text editor", I wrote this : But when I publish my ...
1
vote
1answer
13 views

How to allow an editor to edit all WordPress blog posts but have the last say as administrator?

I run a simple WordPress setup hosted on SiteGround with no staging area and no special roles. The blog grew so much over the last few years that I barely write any content anymore. I send a content ...
0
votes
1answer
22 views

How to display particular set of wordpress post on a webpage?

I have a wordpress/php code as shown below which display list of posts on a webpage. Php code: $special_reports = new \WP_Query([ 'post_type' => 'cpac-special-report', 'orderby' => '...
0
votes
1answer
22 views

Generate new post from email

I have a wordpress site that allows users to set their location when they are logged in, and then uses the heartbeat API to their door display. However, I have had to build in the role of managers ...
0
votes
1answer
13 views

Change the color of the Password Protected Post titles

I want to change the color of the protected post titles. When a post is in protected status (have password), the post title will turn red different from other posts. Please help me, thanks.
0
votes
0answers
17 views

How to show post views shortcode data for each post on Posts List Page?

Example: [shortcode id=""]. I just want to how to dynamically fetch each post ID on Posts Lists page over archive page or normal posts page inside the shortcode placed in excerpt. Currently I'm using ...
0
votes
0answers
10 views

Home.php Pagination 404

The first page (/news) of my main posts page displays properly. However, the second page, /news/page/2, gives a 404 error. /news/page/1 also gives a 404 error. Here's what's in my home.php. This ...
0
votes
0answers
16 views

When the reader enters a password on a post, other posts are not unlocked

I have many posts sharing the same password "123123", when the reader enters a password on a post, other posts are also unlocked. I want to customize it, each post must enter the "123123" pass to be ...
0
votes
1answer
14 views

How can I set a Post's default visibility to private and pending review checked

there are 2 things I'd like to do: 1. set a post's visibility to private by default. I've been looking around the web for a code or even a plugin that lets me do this. The problem I've run into is ...
1
vote
0answers
14 views

WP rest api returns 404 only when author param is used

I have a multisite wordpress installation on aws linux, working perfectly fine. The WP Rest api is also working exactly as it should. Except for one single case. /wp-json/wp/v2/posts?author=<some ...
1
vote
0answers
28 views

How to delete all posts from a custom post type?

I want to delete all posts from a custom post type "TV-Serie". The number of all posts in this post type are 150,000. Moreover, when I try to delete them all manually while selecting more than 500 ...
0
votes
0answers
8 views

Post auto paragraph

I'm trying to use a the js code in the wordpress post (I'm not using visual editor) : <script type="text/javascript">$(document).ready(function () { codes }</script> Unfortunately when I ...
0
votes
1answer
24 views

YOAST SEO won't work on custom post type archive [closed]

I created my custom post type page (archive-objects.php). This page works fine, I have been created page for it and attributed template to it. So everything is okay. But something wrong is with YOAST ...
0
votes
0answers
15 views

Can I Permalink to all posts older than specific year instead of just posts from specific year?

I need add a link in a menu that points to a page with all posts older than 2016 , by default if i link to myblog.com/2016 it will show the archive for that specific year, but I want a link to show ...
0
votes
0answers
10 views

Polylang post_translations key

How does Polylang generate the post_translations key value that it uses to group the original with the translations? I need to make an import with custom posts and their translations, but I can't get ...
0
votes
1answer
27 views

Getting info about selected posts using one WP_Query

I'm currently working on displaying recent posts in 'masonry grid'. Because of multiple issues I came out with the idea of displaying pre-defined rows of that grid (due to designed layout). First I ...
0
votes
1answer
17 views

Admin Notices don't display on the admin screen for certain post

I want to make a featured image required. For starters i am trying to show an error message after update or post buttons are pressed. The problem is that the notices which i try to include don't show ...
0
votes
0answers
16 views

Need to display a Jan 1st post as the site's front page on Jan 1st, and Jan 2nd post as front page on Jan 2nd etc

slightly unusual client request. I'm using Divi and I have a nice Divi layout created for a video and text post which is ready to go. The client wants to create 365 posts (one for each day of the year ...
0
votes
1answer
24 views

Wordpress posts loop pagination - first page return 125 posts instead of 10 and the rest return 10

I'm trying to show 10 posts per page with pagination on WordPress and the first page return 125 posts instead of 10 and the rest of the pages return 10 posts as requested, please assist :) $paged = (...
-1
votes
0answers
8 views

How can show single page view post when user loggedin?

I am new in wordpress. I want to show single post detail when user logged in and post will be show in listing but post detail should be show to loggedin user. How can do that. any code or plugin for ...
0
votes
1answer
20 views

query posts with selected post ids first

Is there a way I can get most recent posts with a couple of posts I specify by post ID listed first? According the docs, the order and orderby parameters may be passed as an array, so in theory I'm ...
0
votes
1answer
17 views

Get queried object for custom post type count

$posts = get_queried_object(); echo $posts->count; I can get post count with this code in taxonomy archive page . problem is that i can not specify post type. i just want count only A custom post ...
0
votes
1answer
39 views

How to change the paginated posts link class?

When using wp_link_pages() to display article pagination, how do I modify the linked class? I want to use different classes to set the previous/next link style. Thanks in advance! Wp_link_pages() ...
0
votes
1answer
21 views

Ajax: load content from post I clicked

Why this load whole page HTML, not selected post content? FUNCTIONS.PHP function my_action_callback() { wp_localize_script('main_js', 'ajax_custom', array( 'ajaxurl' => admin_url('...
0
votes
1answer
9 views

Related Customs posts

Maybe someone can help to make related posts with custom posts type? I am stuck with that... Code is here: https://pastebin.com/zRVjuMBn For example: We are in current post: ID | title | ...
0
votes
2answers
20 views

How to Assign / Move all Deleted post to a category

I have a database of 50,000 articles, One of my categories contains post of 30k, I mistakenly Deleted a category that contains 30k Post, But all the posts still exist. I have search google for the ...
0
votes
0answers
17 views

Filter custom post by taxonomy term

I try to implement filters for the custom post type. I created the container with buttons which represents all used categories: <?php $terms = get_terms( array( 'taxonomy' => '...
0
votes
0answers
14 views

WordPress Wallet/Credit without woocommerce

I am trying to create a credit/wallet like system where user can add their credits from the front-end and when they clicked (buy) a CPT, it would subtract from their total wallet balance. I've tried ...