SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    custom post type issues please help

    I run a vote exchange website called Vote requests

    This site is build using custom post type “contest” in wordpress and many custom fields. The posts are ordered by using a custom field named “Top Contest Order”. There is something strange in the site currently that is for only some users around 10%. When they add contest only this custom field is not added and as per ordering functionality if this is not added then that contest will not be displayed. However this contest displayed in admin but not displayed in ordering because of this custom field entry and strange thing is its only for some users.


    When a user fill out the request form the contest is supposted to be posted right away but at times its posted to admin and I have to manually update it to post on the front end. I thought maybe it was a cache issue, but its not, I thought maybe it was a browser issue but its not I can't seem to replicate this issue by testing. So any solutions would be greatly appreciated

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2011
    Location
    Kolding, Denmark
    Posts
    108
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Without any code pieces or error messages there's no telling what's going on. It's good idea to start with a code that saves those custom fields, could be a problem there. That action is usually hooked up to save_post action,
    Code PHP:
    add_action( 'save_post', 'my_custom_save' );
     
    function my_custom_save($post_id) {
    //deal with all custom fields
    }

  3. #3
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are no error messages, just some posts are posted in the back end instead of front end, this only happens to 10 percent of users I have tried to replicate this by making numerous posts, but it posts on the front end That is why its so difficult to diagnose for me and fix

  4. #4
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    contest order.PNGcustom order 2.jpg



    here is how it looks on front end and back end

  5. #5
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I pmed u the code ronalds

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2011
    Location
    Kolding, Denmark
    Posts
    108
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    The code you sent is got some part cut off.
    From the part that is there, I don't see anything that is totally wrong.
    Have you set define('WP_DEBUG', true); in config file?
    Do other meta values get inserted into database when "Top Contest Order" insert fails?
    On a side note, it's better use get_posts or WP_Query to access data, rather than querying database directly. Also it's a good practice, to set post meta key names like this top_contest_order.

  7. #7
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi I sent u more code it wouldn't let me send the whole thing so i sent you more pieces of it hope it gives u a better idea, Thanks

  8. #8
    SitePoint Zealot
    Join Date
    Jun 2011
    Location
    Kolding, Denmark
    Posts
    108
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Have you set define('WP_DEBUG', true); in config file?
    Do other meta values get inserted into database when "Top Contest Order" insert fails?
    What about these questions?

  9. #9
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no i haven't set define('WP_DEBUG', true);
    yes other metavalues get inserted when "Top Contest Order" insert fails

  10. #10
    SitePoint Zealot
    Join Date
    Jun 2011
    Location
    Kolding, Denmark
    Posts
    108
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Well, defining WP_DEBUG is kinda important, while developing. It allows you to display or log PHP errors http://codex.wordpress.org/Debugging_in_WordPress

  11. #11
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I'll set it, so do u have any idea what might be causing contests to be stalled in backend? No programmer I have talked to seems to know what's causing this tricky problem even Wordpress experts

  12. #12
    SitePoint Zealot
    Join Date
    Jun 2011
    Location
    Kolding, Denmark
    Posts
    108
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Nope, I have no idea. But I would do two things, first check all the code, that's responsible for adding contests, step by step, to be sure, that each step produces the result expected and second, configure WordPress error logging to gather as much data as possible regarding contest inserts and then analyze that, to see where it actually fails.

  13. #13
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you think it could be a plugin issue, I have multiple plugins installed, Also I have a feature that prevents duplicate contests from being posted but I tested it out doesn't seem to be the problem, I deisgned a special plugin to list the contests in users profile then I have 20 others installed.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •