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
1
vote
1answer
788 views

Change target of view link in admin

We're developing across two sites. One site holds our content, the other actually displays it. So when we are viewing posts in the WP admin, the View link is pointing to the instance it's on, which ...
0
votes
1answer
5 views

Hook when post is set from published to draft?

Is there an action i can hook into when a post is set from published back to draft? I have tried both transition_post_status and publish_to_draft but they don't seem to work when I set the post back ...
1
vote
2answers
25 views

Pull In Two Posts To Custom Post Type `cpt-single.php` File With WP_Query()

I have a custom post type and in the CPT's cpt-single.php file I would like to pull in two posts instead of one. The two posts will be the post the user clicked in the relevant archive, and the next ...
0
votes
3answers
18 views

Execute php after post save/update

I have created a php script (generate.php) which is querying posts on set criteria and then writing result in custom xml file. I would like to execute the generate.php everytime the post Save/Update ...
1
vote
0answers
19 views

Assign category to new post via URL

There are two post categories in my WordPress site, Blog category and News category. I want to create two links in admin dashboard, each of the links will open post-new.php but a different category ...
2
votes
1answer
553 views

Show all posts in sidebar in single.php

Wordpress 4.x Why does the loop.php only show the current post in the sidebar when I view a post in single.php? I have: Post One Post Two Post Three If I view "Post One" (single.php), the sidebar ...
1
vote
1answer
10 views

Adding variable for post title so post template can include auto-generated link to view on external website.com/{post title}

There's an external website that I'll be referencing within my posts that uses the same static format for their pages. Let's say it's website.com/view/1111, website.com/view/1112, etc. What I want to ...
0
votes
0answers
22 views

How to disable single page for specific posts?

I need to disable single pages for specific posts, but only after specific condition. My code is here: add_shortcode('list-posts-basic', 'ant_post_listing_shortcode'); function ...
0
votes
0answers
22 views

Get specific post in MODAL popup

I need to load posts in modal popup dynamically. I have found many solutions but upon trying nothing works for me. The solutions do not load the modal popup at all. I tried getting the ID from the ...
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. ...
0
votes
0answers
8 views

Check post exists by post_name not post_title

Is it possible to check if a posts exists using the post_name (not the post_title)? I'm aware of post_exists() but that uses the title not the name. I'm also aware of doing the following but this ...
0
votes
1answer
534 views

wp_insert_post not inserting post

I'm trying to insert a post when a user (aka me) clicks on the button (this button is inside a meta box on the admin dashboard). This doesn't happen and I don't know why. When I put the content of my ...
0
votes
1answer
13 views

Blog page error 'Index of /blog'

A friend has reached out to me for help and thus far I have been unable to figure out what the problem is - his (outdated no longer supported) theme is not displaying his blog - when you click on the ...
5
votes
5answers
810 views

Remove option to allow trackbacks/pingbacks from post page options

I'm trying to disable all functionality related to pingbacks/trackbacks in WordPress and so far I have this: add_action( 'pre_ping', 'disable_pingback' ); function disable_pingback( &$links ) { ...
9
votes
2answers
19k views

How to Change Order of Posts in Admin?

How can I change the order of posts in the admin dashboard, so they display alphabetically according to title, rather than latest first?
0
votes
0answers
15 views

Limit front-end submitted posts by role

Right, I know this question has been asked, but, none have provided me with a workable solution, hoping someone can help. I created a property listing site using the plugin Essential Real Estate. The ...
0
votes
0answers
12 views

How can i enter common data in each post with custom fields?

I have WordPress blog. that have common content in each post. I want to create custom post type and custom field for any media that can have the same data and just I will write each time different ...
2
votes
3answers
8k views

How to Customize number of blog posts on first page?

Under Reading Settings, I can specify how many blog posts to display on a page. However, I would like to customize this a bit. For example, I want to only display 2 posts on the "/" page, but 3 posts ...
0
votes
2answers
2k views

display content in multiple columns

I am Creating a Multi row , 2 Columns blog Post like this Post #1 | Post #4 Post #2 | Post #5 Post #3 | Post #6 I have found some post useful https://digwp.com/2010/03/wordpress-post-...
0
votes
1answer
542 views

Using Tag Groups: Displaying groups and adjacent tags of current post

I am trying to use tag groups (plugin) and tags as a way to display basic info on a portfolio/blog website's posts. I have organised them as *ex. Tag Group: Year / Tags: 2012, 2013, 2014... etc and ...
0
votes
0answers
7 views

add new - no block

In add a new entry. I have no blocks. What is going on?
0
votes
1answer
508 views

Restrict category access to specific users/groups. Author always has access

I'm running a Wordpress website. I want to make some of the content on it - posts and custom post types, who belong to a specific category - accessible only to the users, who have been granted access ...
1
vote
1answer
14 views

Uppercase first sentence in every post

Brand new to this community but been tinkering with WordPress for years. I would like to edit my website's functions.php file to be able to automatically do a task I have to do manually each day. ...
0
votes
0answers
18 views

Query on a repeater date (acf)

I'm struggling with this. I a have list of date (not fixed, I can have as many date as I want) made thanks to the ACF Repeater. In my query, I want to filter by date. But, I have to hide some post if ...
0
votes
0answers
35 views

Publishing failed. The response is not a valid JSON response

I am using wordpress 5.4.2. I get this error when trying to add a new post. I changed my permalink to Post name sample http://localhost/wordpress/sample-post/ How should i change my .htaccess My ...
9
votes
1answer
28k views

How to get post content by calling ajax?

I am working on a plugin .I have a custom post type team.Custom post has four posts of different categories.I used this code to send post id of each using ajax. $(document).ready(function () { ...
-1
votes
0answers
6 views

WordPress in Image External url Source Add in attachment Custom Post and Post

// $filename should be the path to a file in the upload directory. $filename = 'https://ps.w.org/add-external-media/assets/icon-256x256.png'; // The ID of the post this attachment is for. $...
0
votes
1answer
521 views

How to delete/customize imported demo content from a theme or add my own?

I'm new to WordPress. I installed a new theme and there was no content on the page, then I imported demo data, my database got populated with a bunch of content and there are now many different ...
0
votes
2answers
23 views

Send email to user when I publish a new post

i want to send email only new post publish in wordpress admin when i pulish anything its sending mail to user how to restric this to only new post added to send mail to user function ...
0
votes
1answer
30 views

How to add one time a new page?

I m working on a plugin and i would add a page for every value of my database. But for every refresh, a new page with same name will be added. How can i fix this? for ($i = 0; $i < count($namepages)...
2
votes
1answer
1k views

Order post by year DESC and month ASC

I have a worpresss 4.0.12 website; i created a custom template category-$id.php in which I have to show post ordering them by Year DESC and by month ASC (or a custom field ASC), the result should be ...
0
votes
1answer
536 views

delete_post hook - deleting multiple items

I am using delete_post hook. add_action('delete_post', array($this, 'remove_audio_file')); // delete post event (Using it inside the class). When I delete a single post I have no problem retrieving ...
1
vote
1answer
510 views

Visual (non-HTML) display of post revisions

So you know when you click "show revisions" on a post and can choose to edit any of the recent drafts? I have a client, non tech-savvy, who is frustrated by how the revision previews display as HTML ...
3
votes
3answers
6k views

Categories box not showing on post edit pages

for some reason I don't get the Categories meta box on my standard 'post' edit pages in the wp admin. It shows up on my custom post types, and they show up in the 'Quick Edit' view on the Posts list ...
2
votes
1answer
655 views

Link for the page archive for posts, like using custom post types with get_post_type_archive_link

I am trying to get the page to list all my posts (post type = post) in archive. I can do this with custom post types, with get_post_type_archive_link(), but using get_post_type_archive_link('post') ...
0
votes
1answer
15 views

add all blog posts to folder

I want to add all the blog posts to the /blogs/the-post-name type structure. I can do this through the permalinks settings with: /blogs/%postname%/ but this also affects custom post types resulting ...
0
votes
0answers
11 views

Unable to save or update posts with Emoji

I host my WordPress (v5.4.2) blog on 000webhost.com and I am unable to save any post with emoji characters. I get this error Updating failed. Could not update post in the database I have tried ...
0
votes
2answers
509 views

Remove All in One Seo from Posts for Contributors

I am using latest version of All In One Seo Package. How can I remove metaboxes from posts for User Role: "Contributors"?
4
votes
3answers
2k views

Change permalinks for post type 'post' only

Like many other, I would like to have: domain.com/post-title changed into domain.com/blog/post-title but only for the post type 'post', not for 'page' and especially not for the custom post types (of ...
0
votes
1answer
40 views

Adding an option to post editor to show a site disclaimer or message

I was wondering how I would go about adding an option to add a site disclaimer or message for a published post in Word Press. Something like this (Please See Below) Which by checking the box will ...
1
vote
2answers
838 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'...
0
votes
1answer
641 views

Displaying list of posts in category page

What I'm trying to do: On the category page for each category, instead of having each post appear separately from the other posts (i.e. in a separate container), I want to have a single list of all ...
0
votes
1answer
17 views

Setting posts_per_page for taxonomy term template

I have a custom taxonomy term page set up to display posts associated with that term (taxonomy-insight_type-academia.php). I figured I could use the following to limit the posts on that page based on ...
0
votes
1answer
3k views

I want to get title name of post, but i didn't get by this code. Any suggestion?

add_shortcode('sort_featured_restaurant','sort_featured'); function sort_featured(){ $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { echo '<ul>'; ...
0
votes
1answer
563 views

How to Display Most View Post in the template file?

I need to create most viewed post column in the template file, but based on post view count? Function File function wpb_get_post_views($postID){ $count_key = 'wpb_post_views_count'; $count = ...
-1
votes
0answers
20 views

Font-family CSS dose not work for mobiles

I use Zillah theme free version for my WordPress website. I use 'georgia, palatino, serif' as font-family CSS for my articles. But the font-family CSS are only working for Laptops and i phones. Not ...
0
votes
0answers
22 views

How to write this wordpress code

The idea here is to share bulk WordPress posts between multisite blogs automatically. I have googled some tutorials and I know I can use save_post action hook, switch_to_blog and get_post() + ...
2
votes
1answer
2k views

How to search only by post title and category?

I'm currently working on my first theme (based on underscores) and just realized the search does not return any results if I input a category name, nor does it give accurate results when searching ...
0
votes
1answer
25 views

How many post WordPress can handle?

I am maintaining a multiuser blog site in wordpress cms. I got 30/40 post per day, its mean around 10k post at the end of year. Every post contains a featured image at around 140kb file size. The site ...
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
2 3 4 5
110