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,734 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
1answer
720 views

Customizing HTML Editor Quicktags button to open a dialog for choosing insert options

I am looking for adding custom quicktag buttons, that would allow me to display a intermediary dialog before inserting the code. Situation Clicking a quicktag button opens a dialog or thickbox ...
5
votes
3answers
1k views

How to upload post thumbnail while wp_insert_post?

I am trying post submit on front end. All works without thumbnail uploading and setting. Here is my html form. <form method="post" action=""> <input type="text" name="title"> <...
5
votes
0answers
333 views

How to load paginated post pages via ajax

Here's the case I got: I've setup post pagination for my website and everything works well. Except one thing - on every new page request all the resources are loaded again. This makes the website ...
5
votes
1answer
3k views

Change label of title field for posts in the backend

I am trying to add some HTML to the title label in the backend of WordPress. Attempt 1: I am using the following (simplified) function: function change_post_titles() { global $post, $title, $...
5
votes
5answers
782 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 ) { ...
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 ...
4
votes
0answers
2k views

get_permalink returns default link

I hope you can help me. So I'm using /%postname%/ as permalink structure, and my htaccess looks like this: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /develop/...
4
votes
1answer
322 views

How to sort posts by last name (2nd word) on ONE category only?

I have an "author" category that is used as a list to browse multiple posts containing author biographies. I have Smart Category Ordering installed and right now it is sorted by title ascending. ...
4
votes
5answers
2k views

How to disable Uncategorized category URL?

I would like to disable the Uncategorized public URL (i.e. /category/uncategorized), since I'm not using post categories and already have the posts list with pagination on the main Blog posts page. ...
4
votes
1answer
519 views

Let readers suggest edits from the frontend

I'd like to make my articles editable at the front-end for any reader who visits the site. (More like a wiki). I don't really want to trouble them through the registration process. I have no idea how ...
3
votes
0answers
174 views

What to use: wp_is_post_autosave( $post_id ) or DOING_AUTOSAVE?

I was doing some action on save_post hook, and noticed that there exists wp_is_post_autosave( $post_id ) function. How does it differ from DOING_AUTOSAVE constant? If I want my action not to run ...
3
votes
1answer
708 views

Why is wordpress removing some unicode characters (e.g. some emojis) when I save my post?

Try making a new post, pasting this string of emojis: "πŸ»πŸπŸ¦πŸˆπŸ”πŸ„πŸ¦€πŸ•πŸ¬πŸ˜πŸŸπŸΈπŸπŸŽπŸ’πŸΌπŸ–πŸ‘πŸŸπŸ’πŸ³" and then saving that post as a draft. When I do this (in WP version 4.7.4), it removes the emojis. ...
3
votes
0answers
216 views

wp_enqueue_media() slows down my WP site

My website's been incredibly slow and I installed the query monitor plugin to learn more about the issues that caused this. When loading "New post" page, the following query takes 7,3662 (seconds?!) ...
3
votes
1answer
3k views

why does HTML Tag not working in Post and Page

Though this is not a programming related question but I am facing a bitter experience with this WordPress problem. the problem is HTML Tags are not working in my website. See the images
3
votes
0answers
55 views

Showing random content / pictures from earlier posts in a sticky post?

I have a sticky post on my wordpress blog, in the beginning. I would like to place some random content in it, by simply replacing some HTML in the post content. The random content would come from ...
3
votes
1answer
1k views

using slug instead of ID in admin edit post url

In Admin, is there any way to use a slug instead of a post ID# within the URL that takes you to a post's edit screen. So instead of: http://example.com/wp-admin/post.php?post=5562&action=edit ...
3
votes
0answers
329 views

Add custom field to category of custom post type

I want to add a custom field (for a icon) to categories of a custom post type. I use the default category type and not a own create category taxonomy. How can I add the custom field only to the ...
3
votes
2answers
2k views

Wordpress Child Category Display All Posts

I am creating a Wordpress page where all my posts in the child categories of team are displayed in a grid. I got this working with the below code. The formatting and general layout is great however it ...
3
votes
1answer
486 views

Change post format using custom field

I'm creating a theme using the CF Post Formats plugin. But I've run into some trouble I don't know how to solve. Here's what I want to be able to do: Create a new standard-format post Enter a url ...
3
votes
0answers
413 views

Post in Multiple Categories to stay in current category (permalink, next previous post link)

I guess this has been mentioned before, but after 2 days of browsing i haven't find a complete solution. Maybe someone has come across this problem before? I'm building a designer portfolio where ...
2
votes
0answers
27 views

'Invalid post type' error when importing from one site to another

Our existing corporate site was developed by a 3rd party vendor. I am in the process of creating a new version of our site, in a new WP instance. I need to export the 'News' articles, from the current ...
2
votes
0answers
9 views

How to automate filing a form as a user

Sincere apologies if this has been asked and answered. I'm a software developer with almost 0% experience in web. I write C/C++ engineering applications. I want to automate filling in a form on a ...
2
votes
0answers
115 views

Any idea why wp_insert_post is succeeding but not returning?

I have a genuine mystery. With this code (in an ajax call): file_put_contents(ABSPATH.'wp-content/debug.log', 'Inserting new note' . PHP_EOL, FILE_APPEND); $post_id = wp_insert_post( array( ...
2
votes
0answers
42 views

get_queried_object error How to show post count by month in the taxonomy page

Can anyone help me please. i want to show custom post type count by month of taxonomy in archive page for current year. Example: January 24 February 43 March 5 April 6 and etc. This code is help ful ...
2
votes
0answers
83 views

How can I control multiple editing of wordpress posts?

I am managing multiple authors blog, I have issues of editors taking over the stories that someone else is currently editing. The default wordpress warning will display but some of them ignore it and ...
2
votes
0answers
60 views

How to change ID of an attachment in wp_posts and its related tables correctly?

I have two posts in my wp_posts table where post_type='attachment' The picture below shows the records related to those in wp_postmeta table I need to change the IDs of those files. What I am doing ...
2
votes
1answer
529 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 ...
2
votes
1answer
25 views

Export posts manually selected by end user (not logged in)

For an intranet project, I'd like to have not logged in users be able to manually check posts (with checkbox in front of post title on archive page) and be able to export some predefined data about ...
2
votes
0answers
53 views

Check Title Unique Or Not and If not error message and dont save

i am get tired from searching 2 days for what i wanna i have 'area' custom post type have Title and another field i wanna the title of area is unique if the user enter title 'area1' and this title ...
2
votes
1answer
885 views

Working Bootstrap Carousel Conversion to WP - Technical Questions

I have coded a working Bootstrap carousel, it needs to be converted to WP. It's a small chunk of the site, but as a Wordpress newbie, am stuck in understanding the technical issue. So here's what I ...
2
votes
0answers
259 views

How to change the page break <!--nextpage--> URL from ../post/2 to …/post/page2/

I am referencing the WP codex here: https://codex.wordpress.org/Styling_Page-Links but cannot find a way to customize the post URL for page break ( ) feature. For exmaple: instead of the traditional ....
2
votes
0answers
540 views

Create a Wordpress post using curl comand from Linux console?

Is it possible to create a Wordpress page or post with a curl command from Linux console? I tried using the available REST API, but for some reason can't figure it out. If you could give me an ...
2
votes
2answers
980 views

Add Category name to Post Title (h1)

How to add Category name to post title (H1)? β€œPostTitle + CategoryName”? My h1 post title code: <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
2
votes
0answers
583 views

Search query - exact post title match

I have a bunch of posts titled something like this... English Language 2015 English Language 2016 English Language 2017 English Language 2018 And on each one of these posts I have a dropdown select ...
2
votes
0answers
33 views

How to add a custom field after wp post

I want a subtitle box after the title. How to show it in the post editor?
2
votes
0answers
2k views

Warning: Creating default object from empty value in … /post.php

Strange problem - when I want to add a new Post or Page I get the following error: Warning: Creating default object from empty value in /home/www/wp-admin/includes/post.php on line 641 And I am ...
2
votes
1answer
46 views

Hiding posts in a list from specified categories

Question How can I modify this code to not show posts from new categories that we just added. I searched other similar answers on this site [such as: Exclude category on blog list page ] but not ...
2
votes
1answer
646 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') ...
2
votes
0answers
143 views

Wordpress menu that shows all posts in a certain category like w3schools

I am working on creating a widget menu(kind of a sidebar like w3schools) that is supposed to show all posts that are listed in a particular category. And update automatically from particular category(...
2
votes
1answer
143 views

Filter Posts by Excluding Categories

I am logged on as admin I am on the Posts dashboard I have Posts assigned to multiple Categories and I have posts that are assigned to only one category. I want to display posts that are assigned ...
2
votes
1answer
954 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 ...
2
votes
1answer
2k views

how load content as pop-up using ajax

There's a way to use ajax to load the content from single.php or a custom .php like ajax-single.php like this page does it: https://yellowimages.com/all/objects/apparel-mockups/ also like them show ...
2
votes
0answers
93 views

I am having a problem with form updating/editing Wordpress post on the frontend

I am having a bt of a problem trying to allow users to edit their own posts (custom post type) on the front end. the form is being displayed and errors are displayed but the form is not updating the ...
2
votes
1answer
547 views

How to display related posts from parent category

I am using the following code to display the related posts but it is showing posts for that category only like brand showing brand posts only. What I am looking for is if I select any of the posts ...
2
votes
0answers
19 views

Link post permalinks to subdirectory /post

How can I get '/posts/' before my posts without affecting pages and post-types? When I change the permalink settings in the wp-admin all changes. I only want the posts to change. I made an Blog ...
2
votes
1answer
323 views

Conditional that checks if a current category has any subcategory with posts

I'm looking for a way to make a conditional rule that checks, in a category archive template, if the current category has any subcategories with posts. More specifically, the posts are "products" in ...
2
votes
1answer
1k views

How to edit wordpress RSS feed to show post title only

Hi everyone can someone help me on how to edit WordPress rss feed to show only title of the post, i use android application that display notification as rss feed that's why i want to show only a title ...
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 ...
2
votes
0answers
41 views

Changing html lang depending on author

I have a blog with where I post in English and my girlfriend in traditional Chinese. I have tried to add a script that changes the HTML Lang tag depending on if its me or her that is the post author. ...
2
votes
0answers
3k views

Force update all posts in custom post type, no content changes

I have imported data from a custom post type that has location data for a map plugin (Progress Map). I have about 500+ posts each with different location data. For some reason the location data isn't ...

1
2 3 4 5
…
35