PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Make a sticky entry?

  1. cgl
    Member

    Is there a way to connect the WP sticky entry function? I'm using Gravity Forms to allow a client to submit entries from the front end, and I would like to have the same "Sticky" option in the form as appears in the WP backend.

    Thanks for your help.

    Posted 14 years ago on Thursday November 17, 2011 | Permalink
  2. Would you want all the posts submitted via the form to be sticky, or do you just want to allow them to check sticky, or not?

    In either case, you can change the post status using the gform_after_submission hook. Instead of changing the post content (as in the example) you would change the post sticky status, based on the value of the checkbox (if you are doing this conditionally) or for all posts created with your form.

    Posted 14 years ago on Thursday November 17, 2011 | Permalink
  3. cgl
    Member

    I would like it to be an option to make the post sticky, i.e. a checkbox. Would I need to use $post->post_status? Would the sticky value be $sticky? Unfortunately, I'm a real hack when it comes to php.

    Posted 14 years ago on Thursday November 17, 2011 | Permalink
  4. esnoke
    Member

    Chris - I want to do the same thing but I don't know much (any) php. I looked at the "Gform after submission" link and I understand in theory how I can change the first example but lack the know how. Would line 9 on your link look something like this?

    $stickies->is_sticky = true;

    Also, where do I put this code?

    Thank you for your help!!

    Posted 13 years ago on Saturday May 12, 2012 | Permalink
  5. esnoke
    Member

    Hi - just checking in about my question above posted a week ago - Thank you!!

    Posted 13 years ago on Sunday May 20, 2012 | Permalink
  6. I'm really interested in knowing how to do this but am not sure how to go about getting started.
    I'd like to add a an option to make a post sticky or not.

    Can anyone offer any assistance?

    Thanks for any help in advance!
    -Jack

    Posted 13 years ago on Thursday June 7, 2012 | Permalink
  7. David Peralty

    esnoke - Where to put code: http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    voltronik - The hook and instructions have been listed above by Chris. If you don't have the development skills required to make this modification, please post it in our Job Board and I'm sure someone would be happy to help.

    Posted 13 years ago on Thursday June 7, 2012 | Permalink
  8. No, no. That's fine.
    The thread was a little sporadic and didn't realise that's where I needed to start.

    Thanks for pointing it out in your reply.
    -Jack

    Posted 13 years ago on Thursday June 7, 2012 | Permalink