Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Whoops, should’ve noted that the CSS changes are in wp-admin.css, which is in the wp-admin folder.

    I think what makes it especially complex IMO is that you’re trying to do a bunch at once, and when you throw in Ajax (for the last one), then it’s getting even worse. For that matter, seems to me the majority of what you want would have to be dynamic, and that’s Ajax, not PHP, so I can’t really help you there.

    The simplest approach is to edit the CSS a little, which I’d been doing myself in the functions.php — but for some reason, this has stopped working with 2.8.2., so instead I edit the core css file and make note to redo with next update (it’s pretty harmless change, overall). On lines 1852 and 1860, change the height to 100% (both should be for #categorydiv and variants). That, at least, will open the category list box wide so you’re not looking at only seven options at a time, if none of the rest works for you.

    To force single-choices for each, you need radio boxes, not checkboxes. Hmm. I would suggest perhaps starting with the notion of metaboxes — but not exactly. Instead, disable the category box (via screen options) and re-introduce the same variables as a metabox, which will mean some funkiness at the end to add those selected categories back in, but still has to be easier than writing Ajax to do it dynamically after it’s loaded.

    Just of the top of my head, I’d first try to call up the categories into radio boxes so the user’s forced to pick only one per. Then collect those when the post is saved, and compile as array and update the post categories. Maybe something like the following (with apologies for the radiobox html, since I can’t remember precisely how it goes):

    function new_meta_box() {
    global $post;
    //$catlist = ((( insert query to list all categories that are children of X parent )))
    echo (((parent))).'<br />';?>
    foreach ($catlist as $cat) {
    $catID = $cat->ID;
    <input type=radio name="category_1" value="<?php echo $catID; ?>"><?php echo $cat->name; ?><br />
    <?php }
    // repeat for next set, if you want all categories in same meta-box area
    } ?>

    Do action/filter etc per usual metabox, something like:

    function create_new_meta_box() {
    global $post, $theme_name; add_meta_box( 'box2', 'City', 'meta_box', 'post', 'normal', 'low' );}
    function save_meta_postdata( $post_id ) { global $post, $new_meta_box;
    $data1 = $_POST['category_1'];
    $data2 = $_POST['category_2'];
    $data3 = $_POST['category_3'];
    wp_set_post_categories($postId, array($data1, $data2, $data3 …));

    Alternately, you could set up the $data intake as a loop and use array_push to create an array automatically. Whatever way gets it in, via the form needed, and that might be a decent hack to at least prevent multiple-choices w/in a sub-category.

    Though one tip about metaboxes: sometimes it won’t take for some reason. Check the $post_id format — at some points, it’s $post_id that’s carrying the ID as variable, other times, it’s $post->ID that will get you the right value. I have no idea why it’ll be one, then the other. I just fiddle with them until it does what I want.

    Good luck, sorry I can’t be of more help.

    wp_set_post_categories($postId, array(cat1ID, cat2ID, …)),

    I went & looked at the actual output of the page, and under the request-for-comment, there’s a line that says:

    div class=”wpcf7″ id=”wpcf7-f1-p42-o1″

    In your place, I’d open the comments box for a different post, and check to make sure the class is the same (wpcf7). If it is, try adding a line to your theme’s css file that says something like:

    .wpcf7 {border=1px solid #000}

    …or whatever combination you’re wanting for a border. I’ve found that with some plugins, the css markup can be so crazy and snowflake-unique that the only way to do it is create a section at the end of my theme’s css file that contains all exceptions/edits to plugin styles, to bring them in line with what I want.

    Unfortunately, this probably means you’re going to have to twiddle it a bit, until you figure out which class or id in the contact form will get you what you want. Good luck!

    Can you do it via the functions.php file in your theme? I think that’s loaded after the core functions, or at least that’s my guess — I’ve done a handful of additional functions in my theme that modify existing ones.

    Well, more precisely: I’ve copied the function from the core, changed it to suit me, gave it a different name, and then called that function instead. Not sure if that’d work for whatever you’re trying to do.

    It’s back down again. I get that offline versioning would be a nightmare, but what about a mirror, at least for the docs-section? Something that gets updated maybe once a week, and is noted as a simple static output for when the main site’s not available. Or a redirect that takes me there when I would otherwise hit the repeated 403-no-access error thing?

    kaigou

    (@kaigou)

    When it does something like that (show the last 9 no matter what), usually that means something’s defaulting, somewhere. Does the plugin specify whether the ‘name’ is the slug or the actual name? Whichever you’re using, did you try the other? Like, category name (seen by user) may be “cross country skiing” but the slug is ski_xctry.

    But if all you want is to show posts in category 1 in one section/column on the front page, and posts from category 2 in a another section, why not just tweak the front page’s code a little?

    ie, in section one:

    <ul class="list">
    <h2>school updates</h2>
    
    <?php $feature_post = get_posts( 'category=39&numberposts=4' ); ?>
    <?php foreach( $feature_post as $post ) : setup_postdata( $post ); ?>
    [continuing with rest of usual loop for posts]

    that shows the last four posts in category #39. then do it again for the next section you want to display:

    …get_posts( ‘category=51&numberposts=6’…

    and so on.

    Thread Starter kaigou

    (@kaigou)

    Went back, dropped the db, created a new one, did completely new install from ground up. Plugins, usual set up, everything was fine, until I decided to test by changing the wordpress URL: immediate error 500. I went into the db and changed it back to the dev URL, and no more error. Then I changed the blogsite URL, and the same thing happened.

    I don’t know if that makes it a bug, or what, but changing either of those URLs causes error 500s to take over the site, and for the theme to disappear.

    Thread Starter kaigou

    (@kaigou)

    I should add: I also tried removing htaccess (didn’t fix), removing php.ini (didn’t fix), then removing both (didn’t fix). So… no idea.

Viewing 8 replies - 1 through 8 (of 8 total)