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).

1,739 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
41 views

How to change the post type a theme shows by default?

I have a theme that displays the normal post_type post, but want it to take the post from my custom post type my_posts_custom. I don't want to make this change manually on the theme. Are there any ...
1
vote
1answer
1k views

After database migration, posts not showing up in dashboard

Transferring domains, I migrated a WordPress database using the export/import functions in phpmyadmin. Everything worked as intended, until I tried to change permalink appearance in the WP dashboard. ...
1
vote
0answers
316 views

Show the content that is after the excerpt using child theme

How do I set a value for $stripteaser using the functions.php file in a child theme so that when the_content() is called on post pages only the post exerpt is shown? I have a theme that I am using. ...
1
vote
0answers
249 views

Display Meta Values in Custom Filter - Admin Custom Posts

I have created a Custom filter for a custom post. I based my code from here - Add filter menu to admin list of posts (of custom type) to filter posts by custom field values and it works just fine. ...
1
vote
0answers
457 views

how to replace source “ https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css” in the wordpress backend?

i got a problem in my blog https://www.imhunk.com backend, when i edit a post, it takes a long time to open the post and i tested the network in chrome, it shows the source https://ajax.googleapis.com/...
1
vote
1answer
26 views

Get all attachment by post excluding featured and content inside

I have a portfolio where for each item i have some images inside the content, a featured image and a custom filed called "portfolio images". I want to get all images by post excluding the fetured ...
1
vote
0answers
104 views

Ajaxify This Code

I have some code here which updates my post query but the problem is that it reloads the page every time which I don't want to happen. Does anyone know how I can turn this piece of code to an ajax ...
1
vote
0answers
47 views

Decide user that can publish a post

I have the users that can send posts as pending for admin approval. Is it possibile to have that the user that add this post (as custom type) may choose another user that can publish that post?
1
vote
1answer
23 views

Several post types on WP Query by tag and taxonomy

On my taxonomy page I have to display several post types (album, filmes, reviews, video and post) on the same list, with different designs for each. I can display the posts easily, but when I try to ...
1
vote
0answers
32 views

Prevent Delete Attachment by URL or When Submit

This code is working, which prevent being deleted by specific title: add_action( 'delete_attachment', 'check_relations' ); function check_relations( $post_id ){ if(get_the_title( $post_id ...
1
vote
0answers
305 views

No Permission to add new Page, Post or CPT with Admin role

After a server update, I got some problems on my website, running WordPress 4.9.2 I could not update WordPress version to 4.9.4, cause I was getting a message like this: Another update is ...
1
vote
2answers
841 views

Automatically add custom fields value to wordpress post

i want to auto add custom field value when post publish , my custom fields name is "quality" and the value is "HD" . i've look through this site and apparently codes i found is not working. so far i'...
1
vote
0answers
14 views

How to use format post in a pertinent way

I need to create a video post for my theme. I want to use post format via: add_theme_support( 'post-formats', array( 'video' ) ); So it is good, in my single.php I will able to get: if ( ...
1
vote
1answer
56 views

How can I get global $post to work for CPT and update user?

Ive created a custom field in my user_meta which now I want to update the count each time one the user posts are viewed. Ive got this which works great for standard wordpress posts. However I need it ...
1
vote
0answers
40 views

How to allow users to post only in certain category and hide elements from edit page?

I need your help, I am really desperate. In the beginning whenever a user is registered I create category with name based on that user's team name. That user also gets a unique custom role '...
1
vote
1answer
55 views

Can wordpress post and sidebar remain visible after scroll?

My problem is that I have a long sidebar and most posts are somewhat short so when the user scrolls down after the end of the post they only see blank space on the left and just the sidebar on the ...
1
vote
1answer
25 views

Non-existant URL redirects to existant one

I have the pet-insurance-reviews URI under my website, which redirects to review-for-pet-insurance after update of the permalinks. The WordPress Object cache was flushed using WP CLI. There is no ...
1
vote
0answers
278 views

How to switch wordpress post status between publish and schedule in MySQL?

I am writing a program to switch a post between publish and schedule For a scheduled post, I try to set post_status from future to publish, and set a past time to post_date and post_date_gmt, but the ...
1
vote
0answers
200 views

How to copy posts from one site to another in real time (not multisite)

I'm working to rebrand my company's website (new look, URL, etc.). I've already transferred all of the existing posts, pages, users, media from site B (old) to site A (new) and I have site A up and ...
1
vote
1answer
117 views

Excerpts on category page

Is there an easy way to get a specific category page to display excerpts with x amount of words then have a read more link to link to the full post? I've tried the advanced excerpts plugin which does ...
1
vote
0answers
73 views

How to Next and Prevous Navigation Buttons on the end of the page with custom image Using Wp Post Navigation Plugin

I am New to Wordpress and Don't know Coding hecnce on my website i have two section one for blog and other is episodes with seperate catageory and to navigate between the post in same catageory, So ...
1
vote
1answer
270 views

Meta value does not save for scheduled posts

I created a metabox into my posts, it's a checkbox that I checked. Here's the code for saving the data : add_action('save_post','save_metaboxes'); function save_metaboxes($post_ID){ if (...
1
vote
1answer
20 views

How can I check if a var is equal a translated label?

In my plugin, I can publish a custom post. When I click on the "Publish" button, I have this data $_POST Array ( [foo_title] => test [foo_price] => ... [save] => Publier ) ...
1
vote
0answers
69 views

Custom Posts Query and meta_query Sort Order

Preface: I'm fairly new to the more complicated Wordpress development, but not new to PHP. I am having an issue with getting a custom posts query to order exactly as I want. I am using a plugin that ...
1
vote
2answers
1k views

custom post type category count shortcode

I'd like to create a shortcode that would display the post count for a specific category within a custom post type. I've been trying to alter the code below but need some help. Could anyone let me ...
1
vote
0answers
66 views

More then one menu items are assigned with “current-menu-item” class

I am new with WordPress so apologize if i am doing this in a wrong way. I have lot of taxonomies and posts types. I am using one term (from any of the taxonomy) in more then one places in my menu but ...
1
vote
0answers
21 views

Portfolio Page for Classic Posts

My theme has an 4 column portfolio page layout for my portfolio posts. And when I add a portfolio item it automatically shows up in my portfolio page. That's okay. But I need to do this for classic ...
1
vote
2answers
42 views

How can i delay reading posing in 3days for not logined user?

if( ! is_user_logged_in() && ( in_category( 'test2' ) || in_category( 'test1' ) ) && ( current_time( 'Y-m-d' ) <= get_the_date( 'Y-m-d', strtotime('+3 days') ) ) ){ echo 'sorry'...
1
vote
1answer
36 views

Posts list in custom taxonomy

I have someting like this: $terms = get_the_terms( get_the_ID(), 'kosmetyki_dystrybutor'); $terms_ids = []; foreach ( $terms as $term ) { $terms_ids[] = $term->term_id; } $args = array( ...
1
vote
0answers
1k views

How to pull email and name from Flamingo plugin

I am trying to pull the name and email from the database and show on the front end of my website. I tried many scripts and looked on the flamingo forum as well. But couldnt find a solution. All the ...
1
vote
1answer
54 views

Does an action fire when adding a tag via the “Tags” meta box?

When a user adds a tag to a post, I'm trying to determine if they have permission to post in to that specific tag. If the user is not assigned to a tag that they try adding via the input in the "Tags" ...
1
vote
0answers
561 views

Add post location with mile radius allowing search

I have a custom post type (CPT) called directory. Within this CPT there are taxonomies such as builder, plumber, painter etc. I would like to be able to add a location and a distance radius where the ...
1
vote
1answer
42k views

Post + form + action + results on the same page

I'm trying to put on a post a custom form and, on the same page I'd like to visualize the results of an action on the form. But I'm missing the basics. Essentially I'd like to do something like this....
1
vote
0answers
278 views

How to attach an image to a post through Java

I am trying to create post and attach image to wordpress using XMLRPC through Java code. Creating post and pages went out fine but can't find how to attach an image. Please help.
1
vote
0answers
37 views

Is there a way to notify specific users when new posts are published to specific pages?

New to wordpress! I tried searching but couldn't quite find a duplicate question.. Upon having users register, I have created custom fields collecting unique meta data of the users(such as ...
1
vote
1answer
98 views

Convert a complex webpage into WP theme

I am new to the whole WP theme development, but I have undertaken a couple of courses and watched a few tutorials on how to convert HTML/PHP pages into a wordpress theme. However, every single ...
1
vote
2answers
474 views

All Wordpress scheduled posts are being published immediately

I am having a problem when creating scheduled posts. I create the posts as normal, click edit, set a scheduled time and click ok then the shedual button. Soon as i do this i check the website and the ...
1
vote
1answer
33 views

How do I apply friendly URL permalinks to a custom WordPress template?

I have a WordPress site. I created a custom template page which is referenced like follows: /archive-template.php?posttype=publications&taxo=countries&slug=kenya How can I have these links ...
1
vote
0answers
463 views

Open post-content in archive page in a Modal box with bootstrap

on my archive page, i m trying to display the post content in a modal box ( using bootstrap). I manage only to display the first post in a modal box, nothing happen if I click on the other posts from ...
1
vote
0answers
605 views

filter RSS feed in URL

I have been busy with RSS feeds lately so I can auto load my content in my email service. I have build a feed (which works) and inside the feed I can toggle preferences by filtering on categories, ...
1
vote
0answers
41 views

What hook do you use to update a post?

For plugin development if I intend to update a post outside of the query and after so many days based on a category what is the appropriate hook to use? Through research from the query "wp modify ...
1
vote
2answers
39 views

How to add a column to edit posts area in admin panel?

I have a WordPress site, which has a list of playlists, which are essentially custom post types. There is a screenshot below. I want to extend this so it also includes playlist_id as an option of ...
1
vote
1answer
148 views

Get the category from custom post type

I used this code to post articles on the front end: //the array of args to be inserted with `wp_insert_post()`: $new_post = array( 'post_title' => $title, 'post_content' => $content,...
1
vote
0answers
487 views

Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?

I have a couple of custom post types (course and assignment) for an custom LMS plugin that I'm building. The course CPT represents content that is produced internally by the company. The assignment ...
1
vote
0answers
132 views

Search results posts_orderby and ID

I'm using this function for customizing search results: function order_search_by_posttype( $orderby ) { if( ! is_admin() && is_search() ) : global $wpdb; $orderby = "CASE WHEN ...
1
vote
0answers
74 views

How to do set post permalinks using 6 digit random unique function?

I need the following: e.g. www.e.g.com/hello-world to www.e.g.com/9xY52a of course function check 9xY52a inside the databese posts.
1
vote
1answer
249 views

Can't get buddypress notifications in front-end; why do I get this error?

Can someone help me with this? This is supposed to go into functions.php: function cg_current_user_notification_count() { $notifications = bp_core_get_notifications_for_user(bp_loggedin_user_id(), '...
1
vote
1answer
485 views

How to Restrict Previous & Next Post Link to Posts of Same Category?

I am using a category to segregate all posts of that one category to feel like a complete website sub-section. So the main posts feed is using a plugin to hide posts of that category, and I am using a ...
1
vote
0answers
505 views

Encountering “Wrong nonce. Action prohibitied.” when trying to alter User Role and unable to Post via WP Admin

The plugin in question that I believe is displaying this message is the User Role Editor, although I do not believe it is causing the issue as users who should have permissions to make posts on the ...
1
vote
0answers
15 views

Set up post page like JAMA articles

I'm well aware that there are several plugins for creating custom post types. I'm also well aware that what I'm asking probably requires alot of hard coding. But nevertheless, have a look at this ...

1 2 3
4
5
35