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
0
votes
0answers
8 views

search result page first then post in ivory search plugin in wordpress [closed]

i want to show page first then blog post in search result page in ivory search plugin in wordpress. Or any other plugin which can do this. can anyone help me. Thanks in advance
0
votes
0answers
8 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
9 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 ...
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
13 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
17 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
32 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 ...
-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
11 views

How to show category name of the post in Vertical Scroll Recent Post plugin. Plugin only supports date and post_title [closed]

As I am using Vertical Scroll Recent Post plugin in wordpress, but while showing vertical scroll using the said plugin, it only displays date and post_title. I need to display post_date, post_title ...
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
28 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)...
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 ...
-1
votes
0answers
10 views

Trying to redirect to a custom url after saving/publishing a new post [closed]

Needing help sending users to a custom url after submitting a post.
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
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
votes
0answers
17 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() + ...
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 ...
0
votes
1answer
24 views

Query custom post type custom meta key

I want to get all post with the value X looking in the meta_key field. After tha I want to loop trough all post and get the title. I got this so far. function get_events( ) { $recurrence_ids = ...
0
votes
0answers
7 views

Filters post by subcategory slug using buttons

I load in subpage post with one category now i try filter this post by him subcategory and get link to page some like mypage.com/subpage/?slug=fish after click button and see only fish post. I should ...
0
votes
0answers
31 views

Time Stamp In A Wordpress Post Title That Does Not Keep Refreshing

I have a short-code that uses PHP to echo a time stamp ala: 1595140137 When I use that short-code as the default post title in new post, the post title changes with each page refresh, and in the ...
0
votes
0answers
24 views

Sort by date Function ? post date randomizer wordpress

function pdr_randomize() { $randomize = isset( $_REQUEST['randomize'] ) ? $_REQUEST['randomize'] : ''; if ( isset( $_GET['pdr_rd_nonce'] ) && wp_verify_nonce( $_GET['pdr_rd_nonce'], '...
0
votes
1answer
30 views

How do I find the count of the current post?

Let's say my custom post type is 'story'. I've got 20 stories published on my site. So each post becomes: 'story 1', 'story 2', ... 'story 20'. Thus, first post is 'story 1', and last post is 'story ...
0
votes
2answers
16 views

How to get post titles by post ID and integrate with my code?

I have function which gets menu next and previous item url. I want to get also title for them. How can I do this? This is what i have : <?php $menu_name = 'main-menu'; $locations = ...
0
votes
1answer
9 views

How to pull sticky post permalink inside php?

So, I have the following code written inside my function.php. I use it on my blog post to display the sticky post, but my only issue is I'm not sure how to get the permalink inside my HTML. Also, how ...
0
votes
1answer
16 views

Disable posts generated from image uploads

WordPress generates a post for each image I upload. On my site I got a picture assigned to the header: https://autowaschplatz.at/contact/. The image is separately browsable via https://autowaschplatz....
0
votes
1answer
14 views

Check $post->ID against multiple values

i have the following snippet on the site which is working perfectly fine but sometimes I have multiple pages where I want to trigger the event snippet from google, my questions can I add multiple ids ...
0
votes
1answer
19 views

First x post with another template then the others

I want to output the 5 latest posts. But the template of the first 2 must be different than the other 3 posts. So I've created two queries. The first one shows the 2 posts: <?php $loop = new ...
0
votes
0answers
14 views

WP_Query show the posts in sequence of tags entered in Query

Basicly I want to show the post in sequence of what the tags entered are. For instance this is my Query: $args = array( 'post_type' => array( 'providers' ), 'post_status' ...
0
votes
1answer
27 views

How to show only homepage in google results instead of privacy, contact pages

When I search my website in google, all the pages and posts can see. I want to make only homepage visible in search results and remove other pages(privacy, contact etc). And also all the posts can ...
0
votes
0answers
15 views

How to create multiple posts with embedded images?

Here's the problem I want a quick way to create multiple blog posts with embedded images My current process goes like this Create post -> Create block -> Insert image link -> Remove header -&...
0
votes
1answer
23 views

Display/Filter post using if else statement

Here it is: I want to filter my post based on category (Party) If the post with category Party has tag which is 'event', it is the one that will display If there is no ''event' tag, only the recent ...
0
votes
1answer
18 views

How to sort WP_Post Object array by object field in php?

I have a php code as shown below in which I want to sort WP_Post Object array by object field post_date. if ( $search ) { $area_query = new \WP_Query( [ 's' => $search, ...
0
votes
2answers
24 views

Assign custom class to post content images

Is possible to assign a default class to the images that are part of a post content? I have a problem with teh layout, this because the attached images insetred inside a post will break my bootstrap ...
2
votes
2answers
43 views

Importing New Posts from Live Site into Local Dev Site

I'm currently developing an updated version of a live site in a local environment. It's a very large site and the local dev site is using a entirely new theme without many of the live site's plugins ...
0
votes
0answers
21 views

Go back to the exact post page number

I use pagination in my index.php and I have many posts per page. Every post have a button to go back to home. The problem is that when I visit a post in a page 5 for example, the button always send me ...
0
votes
0answers
61 views

Limiting the Number of User Posts to Their Own Posts

I have set users to only see their own posts. But the total number of articles is still visible. Can we limit it to its own number of articles? How can it be done without plugins? related picture here:...
1
vote
0answers
22 views

Automatically create child pages and grandchild pages when saving a (parent) page

I have a bit of a tricky one... I have a hierarchical Custom Post Type ('shows') that represents events. Is it possible for the user to create a new page (ie show), save the page and for Wordpress to ...
0
votes
1answer
33 views

How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count?

How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count? PHP and Html Code <?php //get your custom posts ids as an array $...
1
vote
1answer
17 views

Add icon/badge next to posttitle of specific category

I would like to place an icon in the post title of every article from the category "plus". This is my attempt for function.php, but it doesn't work that way. Can someone please give me some ...
0
votes
1answer
23 views

API endpoint to get most-read and popular posts

I am reading Endpoint reference exposed from wordpress api but I don't see an endpoint to get most read post(s) and popular post. There is an endpoint to retreive all posts https://example.com/wp-json/...
0
votes
0answers
18 views

Post count doesn't match number of posts shown in list in admin

Please check below screenshot and let me know how is this possible. If I am logged in blog page shows 3 posts on page, if logged out then it shows 4 posts
1
vote
1answer
65 views

How to add post_type=value when editing that post type in the Wordpress admin?

So basically in The Wordpress Admin when you are editing a "post" you have a url slug like... post.php?post=829&action=edit&classic-editor I would like to know, is there a filter or ...
0
votes
1answer
29 views

How to add class to specific navbar item when post parent category is in specific category

I have website with pages which are named the same as categories. For example I have page called Cities and also I have category called Cities. I want to add class to navbar item when user is reading ...
0
votes
0answers
22 views

Trying to get post ID outside loop on blog page

I have a blog index page which only lists 1 custom post at a time on the index page (it is paginated). I am trying to get the ID of that post from outside the loop (in the footer, after the loop) but ...
0
votes
1answer
21 views

See if a post has a specified tag

I'm trying to see if a post (thru id) has a specified tag if has_tag( $tag = 'Cat', $post = $post_id ) { $taganimal = "Cat"; } I tried this, but it just crashes the site . Got idea ...
0
votes
1answer
22 views

Search results for ACF data

Is it possible to write a query to search for data from one custom field only? I have a CPT called 'lectures' and I only want to search for data that is in the custom field called 'keywords' I have ...
1
vote
0answers
119 views

Blog post per page setting conflicting with custom WP_Query?

I am creating a theme, and have run into a problem with how a custom WP_Query seems to interact with the Blog pages show at most settings found under Settings -> Reading in the WordPress backend. I ...
0
votes
0answers
16 views

How to sort posts based on likes using Likebtn-plugin

On Likebtn-plugin homepage ([https://likebtn.com/en/wordpress-like-button-plugin#sort_posts_by_likes][1]) they give this code to input in a template file, e.g. index.php, archives.php, page.php, such ...

1
2 3 4 5
110