Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

87
Views
wp_insert_post not displaying posts until hit update in the editor

I am creating a plugin for a theme am using the theme has multiple fields and i field them all using both custom data and fields.

But i am missing something, the plugin creates multiple posts using wp_insert_post Function

but only 1 or upto 3 posts will display in the theme, and if i click update to 1 post on the wordpress editor all the posts show at once as if fixed but there is no additional fields added to the posts meta fields so am confused.

I checked the cache, also when i disable the theme and enable it again all the posts show up so where is the issue coming from and how do i fix this.

Please Help, much appreciated.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

After a Long Struggle i had to read the theme Structure and how it displays its posts and inserts them and found that they have been submitting the posts id's in a file.

So how it works is

when you load the post page the theme requests for posts from file it checks if file exists and time last updated and if time last updated post in database and time last updated file are the same it displays the post id's inside the file.

Conditional Else it updates the file and add the posts id's currently in the database inside the file.

So basically the theme doesn't sort posts directly from the database but file So?

I changed the theme display and make it request Directly from database.

I can't believe it's a very popular theme with a messy code structure.

Well that's all hope it helps those who face same problem.

Else you can ask in this thread i will help if i am able to i am not expert but have been coding for 4 years and still get frustrating bugs like this and it could be that i am impatient eitherway, Jaa :)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!