Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thank you so much for this!

    I used it to figure out how to make a is_category() type archive page. I mean, wordpress already builds a permalinked archive for custom taxonomy terms, but I couldn’t find a way to put a page title on the archive. So, unless you look in the URL, it just looks like a random assortment of posts.

    But I used your code to output the custom taxonomy term within an H1, and also within the TITLE tag.

    For anyone who is interested, here’s the code for the H1, which I basically just rearranged from your code up top:

    if (is_tax('place')) {
    	$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    	$tax_term_breadcrumb_taxonomy_slug = $term->taxonomy;
    	echo '<h1>' . $term->name . '</h1>';
    }
    Thread Starter apatheticresistance

    (@apatheticresistance)

    Thanks Jeremy. Yeah, I saw that writeup, but maybe you or someone else can help me with one part of the implementation.

    From the tutorials I’ve found, it’s easy to use filters to add markup around something that wordpress is already outputting. For instance, if I want to make the post image permalinked to the post, I can create a filter that will wrap the <img> in an <a>.

    So it seems easy to add markup with filters. But can we strip away markup with filters?

    Justin’s filter example wraps the $html variable that the_post_image() uses in an <a>. But how can we take the $html, see what’s inside of that, and extract just the URL? Can filters actually do that?

    Thanks for the help!
    Trevor

    Thread Starter apatheticresistance

    (@apatheticresistance)

    Hi Godfrey,

    Yes, it would definitely be great to see other formats in the next Section Widget.

    Just to share with anyone interested, I figured out what was missing from the equation. I did indeed download the Accordion CSS, and added that into the mix. I used the jQuery UI Themeroller, which is awesome.

    But there was actually another step I think I needed to do. I think that your plugin only includes the jQuery for tabs, and so I had to be sure to include the full jQuery UI library in my templates, or at least the accordion javascript.

    I added this to my <head>, before wp_head() is called: wp_enqueue_script(‘jquery-ui-core’);

    And it works!

    Thread Starter apatheticresistance

    (@apatheticresistance)

    So I found that section-widget-tabbed.php around lines 35-60 has some code for outputting the html content.

    I managed to re-write this so that it matches the example on the jQuery UI Accordion page (h3 heading + div content).

    Unfortunately I haven’t found how to make the javascript work on the new html, though.

    I looked at section-widget.js, which is quite short. I tried changing $(‘.swt-wrapper’).tabs() to $(‘.swt-wrapper’).accordion({ header: ‘h3’ }) but it doesn’t work.

    Any help with this next step would be amazing. Thanks!

    Thread Starter apatheticresistance

    (@apatheticresistance)

    Okay, I’ve sort of found out what’s happening.

    If I start by writing the Title and then continue on by writing the Body, then while writing the body, the permalink is automatically generated and appears below the Title.

    However, if I write the Body first, and then write the Title and while the editing cursor is still in the Title input box, click on Publish, then the permalink will not yet have been generated. So instead of publishing, it generates the permalink.

    So I think that this is somewhere between a bug and an unfortunate situation. Anyway, just thought I would share, in case others are wondering.

    Thread Starter apatheticresistance

    (@apatheticresistance)

    Woah! Your suggestion worked perfectly. Thank you very much Michael!

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