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

learn more… | top users | synonyms (2)

1
vote
1answer
65 views

Only display a certain number of posts, dependent on how many posts there are available in a query

I am trying to write some code for a slider of posts, at the moment my code involves two WP_Querys, one inside the other, but I can't help feeling there may be a more efficient way of doing what I'm ...
1
vote
3answers
609 views

Divide Post content into separate divs for every 500 characters (or any other character counts)

What is the best method for intercepting the_content of a post (for a single post page) and dividing the_content into sections of 500 characters (or any other number of characters), and then ...
1
vote
1answer
330 views

how to hide specific post from google search

I have a wordpress blog set up on my site, example "blog.domain1.com". I have several categories and write posts under each category. I have one specific category that I don't want google search to ...
1
vote
2answers
52 views

is there a better way of combining this?

Hoping someone can point me in the direction of writing this in a more succinct way. I'm working on my website, and want to display a total of 5 posts from the category 'general wonderings'. The ...
1
vote
1answer
71 views

Show posts in category x and y from the 6th most recent post onwards

I'm struggling with the query for this in WordPress to display posts in a category from the 6th most recent onwards. Basically, I have a top 5 posts section at the top of a category for featured ...
1
vote
1answer
222 views

Get the author of the latest revision

I would like to display the author (username) of the latest revision of a post from inside the loop. I tried get_the_author(), which echoes the username and $post->post_author(), which returns the ...
1
vote
1answer
954 views

Show a list of recently viewed posts to a user

I have a lot of video posts on my site and I'm looking to show the user a list of posts they've recently viewed. I'm guessing the best route is to just add the post id to an array in their usermeta ...
1
vote
1answer
809 views

Change slug with custom field

I want to change the slug of a post with a custom field. In example, if the custom field is "keyword" my post link will become: mysite.com/keyword. If the custom field is empty, i want to generate a ...
1
vote
2answers
2k views

Custom Blog Post Page

I found this example here of creating a custom blog post page: http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-homepage-in-wordpress/ 1) I created a blog page under Pages > Add New 2) ...
1
vote
1answer
437 views

Is There A WordPress Plugin That Produces PDFs of Posts Locally?

Most of the WordPress PDF plugins out there use services like Joliprint and Print Friendly to convert posts to PDFs. Is there a plugin that does this locally utilizing the power of PHP (and/or ...
1
vote
1answer
292 views

How do I write this SQL statement for Posts written in last 24 hours?

Someone gave me this SQL code to count the number of posts (of post_type 'mixtapes') in the last 7 days. I tried to convert it to 'in the last 24 hours' as well, but it's giving the wrong number. ...
1
vote
1answer
670 views

Open Wordpress 'Add New Post' admin page with parameters set via $_GET

I want to launch my web browser from an automation tool I use and open Wordpress "Add Nwe Post" page in the admin area with specific title and content (it varies everytime, I generate it dynamically ...
1
vote
1answer
508 views

Comments are assigned to wrong or related post

This issue is driving me nuts since weeks :(( Please help me. The comments are assigned to related posts and are visible on other posts also. For ex. The page redirects to post "Sports" when I post ...
1
vote
1answer
954 views

Wordpress Delete hook with wp_delete_post function?

I have this action/hook: add_action( 'before_delete_post', 'my_delete_function' ); function my_delete_function($post_id) { global $wpdb; $achievement = get_the_category($post_id); $h = ...
1
vote
2answers
2k views

Verify if tag is used on posts

I'm using site tags for a glossary. I would like to display a link to the tagged page if the tag exists, otherwise just display the tag title. Is there a check which would allow me to determine if the ...
1
vote
2answers
2k views

Delete Post Link to delete post, its meta and attachments

I used // Delete Post Link function wp_delete_post_link($link = 'Delete This', $before = '', $after = '', $title="Move this item to the Trash", $cssClass="") { global $post; if ( ...
1
vote
1answer
333 views

[Plugin: Posts 2 Posts] Changing display order of connections

Can I change the order in which connections are displayed ? If I create say three connections and then display them at the bottom of my article, I will get them in reverse order. How can I change ...
1
vote
3answers
483 views

“more” tag doesn't appear when browsing category achives or search

Almost finished my website, but ran into one problem: When you view the archive of a category or do a search, the "more" (or "continue reading") link/ tag doesn't appear. It words fine on the ...
1
vote
1answer
390 views

Enable comments for post with comments meta box removed

I have created a custom post type in a plugin for a site I'm working on. I'm allowing users assigned a custom role to add/edit/delete the custom post type. I would like to give these users as little ...
1
vote
1answer
1k views

How to use WP default post list tables in a plugin?

I'm developping a plugin to manage a base of users and I'd like to show them in the same type of table used in other parts of the WP admin (post lists, user lists, etc.), I'd like to have the same ...
1
vote
1answer
954 views

Get post ID outside of the loop

I am trying to accomplish something somewhat simple I think. I have a menu item at the top of my page that I want to link to the latest post in a certain category. I just need to get the post ID of ...
1
vote
2answers
4k views

Template file for static posts page does not get loaded?

I have this inside my posts page (set in the admin panel: Posts Page: Blog): blog.php <?php /** * Template Name: Blog * @package WordPress * @subpackage Prominent * ...
1
vote
2answers
1k views

Custom Taxonomies Incorrectly Counting Revisions?

(Moderator's note: The original title was "The count of my custom taxonomy is incorrect; it's counting revisions") Has anybody run into this before? I've added two custom taxonomies, and the count ...
0
votes
1answer
19 views

Add category to all post by using sql query?

I have a thousand posts and all them don't have category. Do you know how to associate category with all posts by using sql query?
0
votes
1answer
110 views

Only display sticky post or latest post in custom loop

I'm new to Wordpress and PHP and I've been battling with this for a while now. What I have for the moment is 2 loops. I want to first loop to only ever show 1 post: either a sticky post, or the ...
0
votes
1answer
33 views

How can I group posts by date on frontpage?

For example; 20 September 2014 Post 1 Post 2 Post 3 19 September 2014 Post 1 Post 2 Post 3 18 September 2014 Post 1 Post 2
0
votes
0answers
22 views

How to handle this problem related to the publishing date of imported posts?

I have the following situation that I have to handle: I imported some posts from an old custom blog (not WordPress, a custom blog made using ASP). I exported in CSV format the content of the table ...
0
votes
1answer
123 views

Create new Wordpress post [wp_insert_post] based on results of a WP_Query

I have a a page where users can filter a list of custom post-type posts based on the "Ultimate WP Query Search Filter" plugin. Results are passed to a div on the page using AJAX from there users can ...
0
votes
2answers
96 views

Looking to exclude blog posts from category Previous/Next buttons

I'm working on some conditional elements here and I thought I had it but it's still not working right. You can see my site here. What I've done is displayed only category Legal Libation Columns (98) ...
0
votes
1answer
63 views

Custom Post Type used for FAQs Accordion

OK, so I asked this earlier and no one had any answer for me. I have a CPT for FAQs. FAQs are separated into 'categories.' I need the name of the 'category' then a every post within that 'category.' ...
0
votes
2answers
133 views

Order Posts by Alphabetical for Each Letter

I need to order my posts by alphabetical for each letter. I mean: When people enter to www.xxx.com/a, they will just see posts by starting A. ABC XYZ ADE KLM ARE UYZ When people enter to ...
0
votes
2answers
330 views

Pagination not working on Custom Page Template

I searched a lot on this but I can't figure out why my code is not working. I published a page with slug "blog" that uses a custom built template "page-blog.php" that I build from editing the ...
0
votes
1answer
25 views

Show One Category on Post

How do i go about making the code only show one category? <?php $categories = get_the_category(); foreach($categories as $key => $category) { $url = ...
0
votes
0answers
50 views

Hook into trash_post_comments, update_user_meta

I have a theme where the author get points for posting posts and comments. When I trash a post, the user get 1 point removed from their score. This works fine with this function: However... When I ...
0
votes
2answers
53 views

How to get post body look same as my visual editor?

When I apply the format and styles such as bold and <br/> on visual editor it looks bit nicer. But when I see that on blog post it looks totally different. I do not use any styles for p tag in ...
0
votes
1answer
56 views

Overview with latest edited posts and pages

I'm looking for an overview of all the latest user activities. But I don't want to see comments on this page, just the edits or creations of new posts or pages. Unfortunately I can't find such a ...
0
votes
1answer
48 views

Are all ID's used unique?

I'm using JSON api plugin to pull data from wordpress into an app I am making. I need a unique identifier to make sure I don't have any duplicates WHILE also using the identifier as a way to sort from ...
0
votes
1answer
69 views

Display posts in random post types

I am currently working in a project in wordpress. Here i have to get all posts from two custom post types namely pt1, pt2. But here i want to display posts with random post type(pt1, pt2). Example) ...
0
votes
1answer
70 views

Assigning a role to a specific custom post type (and ignoring other post types)

I have a new post type called "story" And a new role called 'Writer' (w/ a 'publish_story' capability) I want it so that, a Writer when logged in can edit Profile and only edit a custom post type - ...
0
votes
1answer
97 views

Retrieve latest post by multiple categories with ID

I have the categories listed below in my product post type. Category Name: Test 1 ID: 82 Category Name: Test 2 ID: 83 Category Name: Test 3 ID: 84 Category Name: Test 4 ID: 85 Now I want to ...
0
votes
0answers
50 views

exec JavaScript using add_action when publish_post

How can I execute some Javascript code when an user publish a post I want to do something like this before publish a post: add_action ( 'publish_post', 'custom_links' ); function custom_links() { ...
0
votes
1answer
208 views

Enable commenting on front-end preview page for pending posts

We are in the process of allowing authors to collaboratively be a part of the editorial process. They will have access to all pending posts' preview pages (not post-edit pages). I want to allow these ...
0
votes
1answer
707 views

Single.php Active Category Class

Currently by default (I believe) when you're on single.php, Wordpress doesn't add a "Active" class to the blog category you're viewing the single post in like it would for pages or if you're on the ...
0
votes
1answer
2k views

Enable sticky posts to custom post_type

i have this custom post_type: tvr_apartment function custom_post_apartment() { $labels = array( 'name' => 'Apartments', 'singular_name' => ...
0
votes
1answer
146 views

Network wide post count (WP Multisite)

I'm trying to show the total amount of posts of my WordPress Multisite. For that I'm using the following code, which worked at the beginning. So I guess that there's something wrong with the ...
0
votes
1answer
302 views

Create Post tabs in single-{content-type}.php with Custom Field values

My requirement is exactly similar to Tabbed Post. I have Advanced Custom Fields (ACF) plugin to store data. So pulling up the requirement from the wordpress support thread: Movie Summary | ...
0
votes
1answer
185 views

Multiple Loops Breaking Pages

I'm new to WordPress, and I'm having an issue with "The Loop." I have a sidebar on the left side of a page that's supposed to show recent posts from two categories. In the middle of the page, there ...
0
votes
2answers
187 views

How to output comments number of a post per day?

I have a question about the comment numbers in a post... For now, I can output the total number of a comment inside a post outside the loop. That's cool enough, but I want to get show the comment ...
0
votes
0answers
68 views

Add Custom Post Type Categories to General Categories

I've created three custom post types. I want them seen as general categories. I could not find a solution, can anybody help me? Thank you.
0
votes
1answer
186 views

Hide parts of the post content on the home page

I have a post that contains a video (or a slider) and some text. Is it possible to hide the text on the home page, but still display the rest? How would I do that?