Forum Replies Created

Viewing 15 replies - 76 through 90 (of 96 total)
  • Thread Starter 10sexyapples

    (@10sexyapples)

    Well, turns out the $_GET didn’t work, nor did several other options that seemed like they should, what did finally work was this-

    if ( get_query_var('post_type') === 'lesson' ) {
    return 'lesson';

    yay!!

    Thread Starter 10sexyapples

    (@10sexyapples)

    Hey, wait a minute, since I should already have the post_type in the $_GET because the page I will currently be on will be the plural of the custom post type archive, couldn’t I use

    function my_qmt_post_type() {
      if ( isset($_GET['lessons']) )
        return 'lesson';
      elseif ( ... )
    }

    If I’m getting my GETs right, That will tell it which custom post type archive I am on and therefore which custom post type posts to be filtering right? Or am I missing something? … probably missing something.

    Well, last but not least, the hack. You’ve never seen me go with my search and replace functions ??
    14 years of magazine editing doesn’t hurt either.

    After a couple weeks straight of trying to figure out how to make a certain unnamed related posts plugin conditionally separate out my post types with no success, and no help … but lots of attitude from the developer, and clumps of hair all over the floor around me. I was left with no choice but to split it into three plugins to do the job. … heh, yeah, I know, I’m su-per funny right?

    Thread Starter 10sexyapples

    (@10sexyapples)

    Excellent Scribu. And thanks again.

    You’ll have to excuse my ignorance sometimes when it comes to certain things. I come from a 14 year background as a publisher/network administrator/yadda yadda all that that entails, and have only begun teaching myself all of this area ( PHP, MySQL, Javascript, CSS, Html ) in the last two years. I did start to learn Basic back in college … like in 1986! …. ha!, and loved it, and I learn fast, but, it is a pretty big chunk to swallow in such a short time, so sometimes it sounds like I know what I’m talking about, and sometimes I sound like a complete idiot ;-).

    I’m reading and learning all the time, but, still have soo far to go. That said, here’s where the idiot part comes in. I have no idea what it means “exactly” to set a new property. I understand in an ambiguous “theory” sort of way, but, don’t really comprehend what purpose would be served by doing it, or exactly how it would be accomplished “code wise”.

    I’ve looked through your code on quite a few things you’ve written and it seems that you write with a really clean, well-thought out, methodology and that you use very up to date techniques. I will definitely be trying to learn and emulate from your style~

    On the multiple post types. Since you use the QMT_Core class, I’m thinking, for now, I could probably duplicate and make three versions using something like QMT_Core_Lesson, QMT_Core_Howto and QMT_Core_Workshop in order to have the functionality for each post type and it’s archive individually?

    Thread Starter 10sexyapples

    (@10sexyapples)

    Hi Scribu,
    Cool, you’ve set up a filter for a base url, that’s just what I needed. I do have plurals set up for my post types, I just wasn’t sure exactly how to call it in. I can’t just call it in this function with :

    $post_type = QMT_Core::get_post_type(post_type->label); can I? Don’t I need to use $post_type = get_post_type_object(post_type->label);?

    I was also curious with these two filter functions that you’ve given me here how to return more than one post type. Can I return an array of post types here?

    `function my_qmt_post_type() {
    return array(‘lesson’, ‘howto’, ‘workshop’);
    }
    add_filter(‘qmt_post_type’, ‘my_qmt_post_type’);’

    The base url function will get the post_type from the query var that is already in the url from my rewrite code that has created the custom post type “archives” I’m assuming, and will change depending on whether it is coming from lessons, howtos, or workshops?

    I think my logic may be a little twisted right now, so, I’m going to go do a little experimenting to figure this out. I’ll report back~

    Thread Starter 10sexyapples

    (@10sexyapples)

    I made this little change in order to get the url to return to the custom post type that it came from. It’s pretty hacky but, it gets the job done.

    function get_canonical_url() {
    	$post_type = apply_filters('qmt_post_type', 'post');
    		if ( empty(self::$url) )
    			self::$url = add_query_arg(self::$actual_query, get_bloginfo('url') . '/' . $post_type . 's' );
    
    		return self::$url;
    	}

    I know there is a better way to do this, especially getting the plural of the post type, but, alas, I’m still not strong enough in PHP to know the right way. ??

    Thread Starter 10sexyapples

    (@10sexyapples)

    Ah man. Sorry. I just realized I’m in the wrong thread on that last comment. I think my head is somewhere other than on top of my shoulders lately.

    Thread Starter 10sexyapples

    (@10sexyapples)

    There is an old plugin by Alex King called Category Overload that handled this exact thing for categories. It is outdated now, as it uses the old deprecated post2cat etc.. I’ve sent a message to ask if it would be updated, but, really don’t think that will happen, so, I may use that as a foundation to build on, or just start over. Of course, whatever I pull together, I’ll let you know.

    And oh yeah, I need to put some call into the drill down widget that ( in literal terms ) says “if the current post has a custom post type query var “lesson” and no terms are selected redirect to /lessons instead of index.php. I have rewrite and redirect rules in place to send custom post type query variables that don’t contain “name” ( single posts ) to a template that has been set up as an archive. This archive template is where all the drill downs start, and where I want to return to if multitax isn’t called.

    Did I already ask this? I’m sorry if I’m repeating myself. Any clues would be helpful if you have a minute. If not, I’ll keep plugging away ??

    Thread Starter 10sexyapples

    (@10sexyapples)

    1. Okay, I’m going to have to resort to an alphabetic override ?? I’m pretty sure that’s how it’s ordering them.

    2. Yes, I think this must be done, so, will let you know. I had tried some javascript earlier, but, it was over-riding the checkbox and didn’t function right. I love all the new functions etc. that are available to me now, but, man, it sure is making for a lot more work right now with developing – so much has to be re-written to implement all the new toys … ??

    Thread Starter 10sexyapples

    (@10sexyapples)

    Two quick questions:

    1. Do you know if there are any additional options outside of low/high for ordering meta_boxes? I really need to get that one giant taxonomy to the bottom.

    2. In order to make the hierarchical taxonomies (in the $taxonomy-divs meta_boxes created with your code) collapsible so that my client doesn’t have to scroll through 8 or 9 hundred terms in that giant taxonomy mentioned above ( Mark’s category expander won’t work as there are just too many terms to have it all expanded ), do you happen to know of any solutions that would be faster/easier than having to start from scratch writing that function into this one?

    Thread Starter 10sexyapples

    (@10sexyapples)

    Excellent Scribu. Works perfectly, but, I had to change the meta_box priority to low as on high it was positioning itself above the publish meta_box. This was so helpful ??

    Thread Starter 10sexyapples

    (@10sexyapples)

    Email sent ??

    Thread Starter 10sexyapples

    (@10sexyapples)

    Thank you for the info on the_widget function … I can’t keep up with you guys ?? Sometimes I write questions long after I have the mental capacity to even understand what I’m asking, so, sorry for the vague weirdness.

    I played around with everything, got the widget function and the multitax template going, so that is all good.

    My previous confusion was in regards to the fact that there really is no way, that I have found … yet … to have a menu item ( page ) that lists custom post types in an archive fashion, without having to set a page template that queries for the custom post type.

    Let me digress for a moment as it would probably help to know my goal, which is to have a menu item called “lesson plans” that when clicked has all lesson plans ( lesson is a custom post type ) in archival fashion. In the sidebar of that page is the drill down custom taxonomies that have been assigned to lesson plans ( art subject, academic subject, grade, etc. ). I was unclear at first how the multitax template would function, as in, if it would “appear” to still be the same page, only drilled down by the selections of the custom taxonomies.

    That said, I have experimented with the template and it does behave in the way that I need it to. I can’t stand the hackiness of not being able to have something like an archive.php for my custom post type, but, I will probably need to stick with the “illusion” of an archive for now … darnit.

    My question about the multiple instances was just as vague and improperly stated, so let me apologize and elaborate on that as well. I was referring to being able to drill down through all of the multiple instances of the drill down widgets ( gee that was way more specific huh? ?? ). Now, from what I understand, from what you’ve said above, and from the title “query multiple taxonomies” I was under the impression that that is exactly what I should be able to do, but, the way that it is behaving, on my page at least, is that I am able to drill down in one taxonomy widget at a time, but, not in multiple ones.

    Example:
    I have an art subject taxonomy, which contains terms like theatre, music, dance etc., and an academic subject taxonomy which contains terms like math, science, history etc..
    If I click the plus on theatre and then on music, I will get the =theatre+music, but, if I then click on science, it will give me =science only. I am not getting the function of art=theatre+music AND academic=science.

    Perhaps I am doing something wrong? I hope my long-winded-ness made a little bit of sense. My apologies if it sounds like I am talking gibberish again.

    Thanks again for all the hard work too!!

    Thread Starter 10sexyapples

    (@10sexyapples)

    Thanks so much scribu, I’ll be eagerly looking forward to that~

    Thread Starter 10sexyapples

    (@10sexyapples)

    Excellent. Thank you so much. I can’t wait until this is second nature to me. I just have to keep reading my php books. ??

    Thread Starter 10sexyapples

    (@10sexyapples)

    You rock! Thanks so much for responding! I was also curious about two other things if you have a chance to respond … 1. If it’s possible to call function for the widget directly in a non-widgetized sidebar and 2. If it causes any issues calling multiple instances of the function, one for each taxonomy, in one sidebar. Again, I’m thinking that perhaps this is where I would use the multi-tax template? Should I be using the multi-tax template fitted with a custom query for the post type “lesson” in order to have the results of the drill down always remain on the same page? The goal of course being to drill down the custom post type of lesson through all of the custom taxonomies ( art subject, academic subject etc. ) and always remain on the same page. Hope I’m not asking too much ??

Viewing 15 replies - 76 through 90 (of 96 total)