Using a child theme of WP 2013 theme...

In Settings > Reading, 'Front page displays' I have selected 'static page' and assigned it a page titled Home. For that page, I've assigned a custom template.

That template calls a custom shortcode that displays a form for creating a custom post. And a loop to show the 10 most recent post of that cpt.

Everything works fine - except that on submit, it refreshes to the archive page for the category assigned when creating the custom post.

So it searches for that category.

If I call the same shortcode on a different page, such as Contact, that isn't a front page, then on submit it will refresh to that page.

Why does it search for the category when submitted from the front page? And how can I stop it?

  • 1
    paste your shortcode function here, so we can investigate why? – Anjum Sep 5 '13 at 18:44
  • shortcode function added. If I use wp_terms_checklist, it refreshes to home page. But wp_dropdown_categories() or get_categories refreshes to archive page. – shanebp Sep 5 '13 at 19:31

add the_permalink(); in form action value, to submit the form data.

<form id="fep-new-dog" name="new_dog" method="post" action="<?php the_permalink(); ?>">
| improve this answer | |
  • Thanks a lot. Pretty obvious once I see your answer, lol. Also got it working with a htaccess 301 – shanebp Sep 5 '13 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.