Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
0answers
5 views

Create navigation that changes depending on how you get to a single page?

I'm trying to make conditional navigation along the lines of "if a user goes into the tag "foo" make sure the navigation once in the single page only goes back and forth in the "foo" tags. But if the ...
0
votes
2answers
12 views

Disable WordPress Archive Conflict Check

I want to have numerical slugs in WordPress for pages but WordPress doesn't allow this by default in an attempt to preserve the slugs for use by chronological archives. The wp_unique_post_slug ...
0
votes
1answer
13 views

Batch Extract Date from post title and put into ACF custom field

I have a custom post type called 'events' with around 700 posts, the titles are consistently formatted like this: Event Title - January 1st 2019 I need to isolate the date in another field. I am ...
4
votes
2answers
34 views

How to know if get_posts() failed?

So I see that get_posts() function return an array of posts. If there are posts, it returns an array of posts. If there are no posts it returns an empty array(). If there are posts, but the querying ...
0
votes
1answer
23 views

is therer any wordpress function to retrieve a specific html element from post content

I am developing a wordpress blog theme and I want to use the heading1 element(tag) from post content to be used as the title for my posts instead of the default title. Actually, I want the title for ...
0
votes
3answers
27 views

get_the_content if it contains multiple lines it results in SyntaxError

I use get_the_content to pass to a javascript variable, and then back to another PHP function. This works great, but there is an issue when using get_the_content. If the post contains only one line (...
0
votes
0answers
10 views

Post tools gone from right side

Using post editor with Laurel theme. All of my right hand tools (ie. feature image, permalink, etc.) are GONE. I was using visual, sitched to code for a few seconds, then back to visual. Everything on ...
0
votes
1answer
32 views

wp_query with ajax

I am trying to filter posts by year using WP_QUERY with AJAX And the current builder i am using is DIVI(for front end). Result Everything loads fine and i am facing one final roadblock that is when ...
0
votes
0answers
9 views

Featured Pictures on Posts Option Missing

I have just discovered the update by wordpress, which would not allow me to see everything that needed to be edited on my pages and posts (the SEO and related boxes take up the middle of each page ...
0
votes
0answers
15 views

All Post Wordpress Page Error

I set up the number of elements per page in the Wordpress "Post" page in 999 (max) because i have more than 4k post but since i did that every time I want to go to the page and see my post i'm ...
0
votes
0answers
13 views

User can hide post just for him

I have a RSS wordpress site so there are many new posts all the time in different categories. I would like a function so that users themselves can hide posts which they don't want to see again. So ...
0
votes
2answers
12 views

Tags on products vs tags on blog posts. An easy way to duplicate them

So, I was doing some SEO work for my company's website. The website is an online e-shop, where you can learn about their products and make an order. They also got a blog. So far so good. The set up is ...
0
votes
1answer
26 views

How to Display Search Results with any Page/Post

I'm not really sure where I should ask this question so here I am. I have a website that is split into three parts from left to right: Menu (div name "sidebar"), Center Blue (div name "center"), and ...
0
votes
0answers
14 views

Underscores Theme Unit Testing - Catching Untitled Posts

Wordpress 5.0.3 | Underscores Theme I'm unit testing a theme I based on underscores using the wptest.io xml. Underscores does not gracefully catch untitled posts. There is no title in either ...
0
votes
1answer
20 views

How can to use the players from the Media Widgets in the body of a post to play audio and video files

I've been trying to use the <audio> tag to play MP3 files and the <video> tag to play MP4 files, both with the controls attribute, and they work fine, but it isn't possible to apply custom ...
0
votes
0answers
26 views

Bulk trashing post 'fails'

I want to bulk delete child posts of a custom post type, and I've made it work. I'm in class context: // In a register method which registers all hooks. add_action( 'wp_trash_post', [ $this, '...
0
votes
0answers
34 views

get_the_excerpt() is not working as expected - returns wrong text

In my template's 'footer.php', I'm attempting to generate a list of the four most recent blog posts, showing the featured image, title, excerpt, and a link to view. The title, featured image, and URL ...
0
votes
0answers
15 views

How to Automattically Regenerate Excerpt

I constantly update my posts, and one problem i face is that the excerpt is the first few words of the first ever version of my post. This means that even if i update my posts, to update the first ...
0
votes
0answers
11 views

Random 307 redicrect Problem [closed]

Since two weeks, i'm facing a problem with my website that i never heard before. Everything work perfectly on all support ( desktop and mobile for all browsers ). Than a redirect 307 loop happen to ...
0
votes
0answers
11 views

Autosave for frontend editing

I have pages for draft posts, new posts, and all posts. I am using modified version of plugin Frontier Post. How can I have it to auto save the progress on a separate page (revisions page). This ...
0
votes
1answer
9 views

How to display related post from same category in single.php

How to display related the post from same category in single.php. I have tried but it was not working.
0
votes
1answer
17 views

Echo Text If User Is Logged in But NOT the Author of post

i am coding a plugin, where user can subscribe to a indvidual author of post (like we do on YouTube). I want to display the subscribe link to all logged in users, but not the author of post. my ...
0
votes
1answer
13 views

single post showing blank page in custom template

I have converted an html template.In that Single pages are showing up but single post are not displaying anything other than a blank page.How to fix this.Can anyone help me with this?content from ...
0
votes
1answer
24 views

how to add updated_by column to posts admin panel?

I want to have the exact details of the last editor of each post in a separate column on the posting page in the admin panel. How can I do this?
0
votes
0answers
9 views

Trouble importing images into posts

I'm sorry to ask such a question on this forum but I am having a really hard time with this. I am working on a WP site which (for some reason) has another WP installation in a sub directory and this ...
0
votes
0answers
7 views

Passing back page and device information on email capture

I'm trying to pass back information regarding which page a user was on and which device they were using when they submit a form on my Wordpress site. Any ideas how this could be implemented?
0
votes
0answers
19 views

Using a meta_value or postdate to to query and orderby

How do I structure a sql that: 2 checks if meta_value is in future or has no meta_value at all and 1 orders by meta_value (meta_key => datum_event), and conditionally if this meta_value is empty ...
0
votes
0answers
20 views

Wordpress Product Detail and catalog

I want to have post for every product, some product may have similar feature.For example Size with different Value for each one. and some other product doesn't have Size Feature. i see this page and ...
0
votes
1answer
30 views

Exclude posts in home slider from sections

I have home page with a main slider and news section. Main slider Sport section news Economy section news Politic section news and others section The main slider get posts by tag ='slider', and ...
0
votes
0answers
14 views

Wordpress weird behaviour on comments

Every time I make link in one of my posts (post B) to other post (A), The post A gets a comment that it's content is a section of Post(B) that contains the title of the link I've made. As an example ...
2
votes
0answers
21 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 ...
0
votes
1answer
19 views

post thumbnails error

i want to make a wp theme myself almost i do it but there is a biiiig problem and i cant solve it i had add add_theme_support to function and add the post thumbnail in my index but still cant give ...
0
votes
0answers
24 views

$_POST from a Meta Box

From my reading, the editor page of a post is wrapped in a form tag meaning a standard HTML form won't work within a Meta Box. What I'm trying to achieve is a meta box with two fields e.g. Name & ...
0
votes
0answers
18 views

Change related posts by tags to categories

I use the code below to place the related post in the middle of the post. Tags based on posts are the main priority to be displayed, if there are no posts in the tag then he will take from the ...
0
votes
1answer
17 views

How show categories in admin and get that selected to show posts in index

my problem is: I need to offer in admin a page to user select 2 categories. I have 2 containers in index.php showing some posts from some category, but i need to allow user to change what category he ...
0
votes
3answers
10 views

How to enable custom Shortcodes in Post Category Description? [duplicate]

I created a custom shortcode from my child theme's functions.php, And I want that shortcode to display in Post Category Description. But it's not working. Do you guys have an idea on how to enable ...
0
votes
0answers
26 views

How to add google structure data in Blog Post? [migrated]

I want to add Google structure data in WordPress Blog posts, pages. Where i need to place Structure data (in body or head section)? What is the correct schema structure for Posts or pages? Thanks
0
votes
1answer
25 views

Wordpress the_category(); only works with message-posts not with project posts, how do I specify project categories?

The title, the permalinks & even the field of ACF do work smoothly. But the code is not reactive to project categories, when I echo wp_list_categories(); it shows the list of message posts only. ...
0
votes
1answer
23 views

Display images of related posts

How do I display related post thumbnails? This is the code that I use: function related_posts_shortcode( $atts ) { extract(shortcode_atts(array( 'limit' => '3', ), $atts)); global $wpdb, $...
1
vote
1answer
21 views

Define a wordpress constant through plugin functions?

I'm working on a plugin and trying to build in an option to disable post revisions. I have the setting registered, and confirmed that the checkbox is linking to the database. The option value is ...
1
vote
1answer
27 views

Category Page Template not Showing Posts

I am trying to get this template to work.
0
votes
0answers
23 views

Display products wich share custom taxonomy with a Custom Post Type

I would like to create a shortcode that display products wich share custom taxonomy with a Custom Post Type. Example: I have a Custom Post Type called "Songs". I have a Custom Taxonomy called "Music ...
0
votes
1answer
11 views

Display Updated Date Instead of Published Date

Both published and updated date are showing on the post page. How can I replace the published date if the last date is updated? The code is here: Published on <a class="entry-date" href="<?php ...
0
votes
0answers
9 views

Center crop the feature image

Could someone help me to perfectly center crop the thumbnails(feature image) as showing in the picture
1
vote
1answer
39 views

AJAX filter posts by year

So I have a HTML select form which allows users to choose years such as 2017 , 2018 etc Hence, what i want this to achieve is when user selects 2017 , the posts from 2017 will be loaded on the page. ...
0
votes
2answers
9 views

Restrict next_post_link() to current category

The Codex disagrees with itself, so I'm stumped. On single.php I am trying to use next_post_link() to display a link to the next post, with custom link text, within the same category as the current ...
1
vote
1answer
23 views

Posts will not display on page-mypage.php

Something is really tripping me up. I have been used to querying posts via custom queries however based on research lately I have learned that for the most part this is a big no no. So, in testing the ...
0
votes
1answer
16 views

Submit New Post

I'm the junior of wordpress and web designer, there is a stupid question would like to ask. At the wordpress web site, when I create new post and submit. The page will fallback to edit post page. But ...
0
votes
0answers
35 views

Table navigation not showing in wp-admin/posts - *RESOLVED

I am having this issue on my live site only. It seems to be working fine on the staging site. Something is hiding the bottom page navigation with display="hidden" Pretty stumped with this one, anyone ...
0
votes
0answers
11 views

Check to see if a post's child category also has it's parent category ticked

Is there a way I can check to see if a post's child category also has it's parent category ticked? With a warning popup when publish/update is clicked.