WordPress.org

Forums

I want something to "make" me choose a category before posting (30 posts)

  1. vkaryl
    Member
    Posted 10 years ago #

    Is that possible? I'm a fast thinker/writer/clicker-on-the-buttoner.... I want a dialog that comes up to say "Which category do you want to post this to?"....

  2. Anonymous
    Unregistered
    Posted 10 years ago #

    You can try setting default_category to nothing. Go to http://yoursite/wordpressdir/wp-admin/options.php and look for that option. Delete whatever it is set to and save the options.

  3. vkaryl
    Member
    Posted 10 years ago #

    Tried that, thanks for the idea. Didn't work - operated exactly as before, with the "General" category as default.

    Also tried removing the relevant stuff from the section just below. All I got was "Customizing WP" for default instead of "General". Tried all permutations of editing the two sections....

  4. vkaryl
    Member
    Posted 10 years ago #

    I just spent about 4 hours digging through the Codex, and through a couple of hundred pages of google results, to no avail. I also went back and tried the "mess with it" mark suggested again. Still nothing.

    Anyone have any other ideas?

  5. jennmiller
    Member
    Posted 10 years ago #

    Tape a post-it note to the monitor? Actually, I feel your pain. I have to edit at least 3/4 of my entries to correct the category selection.

  6. vkaryl
    Member
    Posted 10 years ago #

    *laughing hysterically* Jenn, I had JUST DONE THAT VERY THING! That's just TOOOOO funny!

    But it's a bit silly, isn't it?

  7. jennmiller
    Member
    Posted 10 years ago #

    Great minds ;)

  8. Joshua Sigar
    Member
    Posted 10 years ago #

    With some javascript that I'm to lazy to figure out. It basically checks, when the Publish button is clicked on, is the category still on default, if so ::sirene::.

  9. vkaryl
    Member
    Posted 10 years ago #

    Hm. I didn't run across any js mentioned in the searches etc. I did earlier. Maybe I didn't phrase correctly?

    [The trick, boys and girls, is not to remember to "search" - it's knowing WHAT QUESTION TO ASK!]

  10. Joshua Sigar
    Member
    Posted 10 years ago #

    I believe no body has done it or asked this question before.

  11. vkaryl
    Member
    Posted 10 years ago #

    Oh. Eww. Bummer then, because I am no coder! I can tweak stuff that's already "there", but that's it. *sigh*

  12. moshu
    Member
    Posted 10 years ago #

    @ mark, you cannot have set category to "nothing". Every post has to have a category, otherwise it won't work. That's why there is always one (the default) selected. Posts (as opposed to Pages) cannot exists without being associated with a category.

  13. vkaryl
    Member
    Posted 10 years ago #

    But moshu, I don't want there "not" to be a category at all, I just want something to poke at me to make sure I choose the appropriate category BEFORE I hit "Publish".

  14. moshu
    Member
    Posted 10 years ago #

    I know you want that, that's why I addressed my reply to mark :)
    I even agree with you... and now for a moment I was thinking maybe to include on the Write admin page some bold red 50px text for myself next to the Publish button, like
    YO MORON, CHOOSE THE RIGHT CATEGORY! ;)

  15. vkaryl
    Member
    Posted 10 years ago #

    Okay - that would be even better than the post-it note! Let me know where you put that okay? I really need that.... I think and write too fast....

  16. moshu
    Member
    Posted 10 years ago #

    Here is what I did.
    Open the wp-admin/edit-form-advanced.php file. (Note: I use the advanced interface!). Around line 114 find this:
    <p class="submit"><?php echo $saveasdraft; ?>... etc
    and right above insert something like
    <p class="warning">IS IT IN THE RIGHT CATEGORY???</p>
    Then in the same folder (wp-admin) open the wp-admin.css file and add this to the end of it:
    .warning {
    text-align: right;
    font: normal bold 25px;
    color: #ff0000;
    }

    Here is the result

  17. vkaryl
    Member
    Posted 10 years ago #

    YOU get my vote for "tweaker of the century"! THANK YOU. I am now reminded right where I need to be (which is what's wrong with the post-it solution: it's one of those after-a-while-you-just-don't-see-it-anymore situations....)

    May you live long and prosper greatly, moshu!

  18. moshu
    Member
    Posted 10 years ago #

    Thank you kindly :) and welcome. Glad to be of help.
    [which century? LOL - I've lived the longer part of my life in the last one]

  19. vkaryl
    Member
    Posted 10 years ago #

    All of them! [93% of my life was in the last one too....]

  20. dawg
    Member
    Posted 10 years ago #

    You forgot the you moron!!!!! I think I may have to tweak your code a bit!!!

    Too funny.

  21. vkaryl
    Member
    Posted 10 years ago #

    Ah - but I put it in on my page when I "fixed" it....

  22. vkaryl
    Member
    Posted 10 years ago #

    moshu, I just want you to know that your fix is the single most useful thing I've added to wordpress. Period.

    Thanks again!

  23. danielck
    Member
    Posted 10 years ago #

    Javascript confirmation box would be good.

    Click on the publish button and the comfirmation box ask if you have choosen the correct catagory. If yes, then proceed to publish. Else, abort submission.

    Let me see if I can tweak the button abit

  24. vkaryl
    Member
    Posted 10 years ago #

    That would be good too, danielck - I just don't "do" js myself, and a big (48pt!) bright red "YO MORON"etc. works for me....

  25. danielck
    Member
    Posted 10 years ago #

    Well, here is what I have done:
    http://www.danielck.net/temp/confirm_alert.jpg

    I edited wp-admin/edit-form.php at line 62

    '<input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" />'

    to:

    ' <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" onClick="javascript:return confirm('Have you select the right catagory for your post?')" />'

    When you click ok, the post will be published. If you click cancel, nothing will happen and yu can amend the category.

  26. bang
    Member
    Posted 10 years ago #

    Works really well danielck. Thanks!

  27. fishcakes
    Member
    Posted 10 years ago #

    A really useful tweak. thanks, danielck!

  28. vkaryl
    Member
    Posted 10 years ago #

    Well, that's just cool, danielck! I am going to have to learn a bit of coding eventually I guess - just look at the useful things a bit of js can do! Thanks to both you and moshu for helping out the local "blond AND senior"....

  29. supamello
    Member
    Posted 8 years ago #

    Hi, I applied the Javascript exactly as danielck suggested, but I get no confirmation box. Why is that? Has anyone else had problems with the javascript? This would be incredibly useful if it worked. Can someone please suggest why it might not be working? Thank you so much.

  30. supamello
    Member
    Posted 8 years ago #

    Just in case anyone else did the same mistake: I figured out why the javascript wasn't working. I needed to edit the 'edit-form-advanced.php' file not the 'edit-form.php' file.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.