Forum Replies Created

Viewing 15 replies - 1 through 15 (of 29 total)
  • alpha_llama

    (@alpha_llama)

    Yea a warning or default = no change to my interface would have saved me a mini heart attack. I thought I botched something with the upgrade!

    Whew.

    11-month-old post atm, but here’s your answer:

    Did you conditionally add your upload script based on the $_GET[page] variable? From, the link you posted they did this:

    if (isset($_GET['page']) && $_GET['page'] == 'my_plugin_page') {
       add_action('admin_print_scripts', 'my_admin_scripts');
       add_action('admin_print_styles', 'my_admin_styles');
    }

    If you didn’t, the the replacement send_to_editor() function will be on every page (including your add/edit post admin pages) and the media uploader won’t behave the way it normally does.

    You can check to see if your ‘my_admin_scripts’ are being loaded by viewing the page source and looking to see if your script is in the head (my-script.js if you’re using the tutorial verbatum.)

    Good luck.

    I’m building a ‘daily special’ plugin for exactly this purpose. Should be ready soon. I’ll post back with a link once I do.

    !cheers!

    So just to be clear, they all look like this now:

    Read the rest of this entry »

    with thre periods on the end of the auto-generated (eg; no custom excerpt or more tag posts.)

    Hope that helps.

    I wanted all my ‘teasers’ to look the same on my front page whether the posts have <!--more--> tags, custom excerpts, or none at all. So I wrote the following code:

    <?php
    /* Continue Reading Stuff */
    
    function my_continue_reading_link() {
      return ' Read the rest of this entry »';
    }
    
    function my_auto_excerpt_more( $more ) {
      return ' . . .' . my_continue_reading_link();
    }
    
    function my_custom_excerpt_more( $excerpt ) {
      if ( has_excerpt() && ! is_attachment() ) {
        $excerpt .= my_continue_reading_link();
      }
      return $excerpt;
    }
    
    function my_the_excerpt() {
      if( has_excerpt() ) {
        // Post has a custom excerpt
        return get_the_excerpt();
      } else {
        if( strpos( get_the_content(),"class=\"more-link\"" ) ){
          // Post has <!--more--> link
          return the_content( my_continue_reading_link() );
        } else {
          // Post does not have <!--more--> link
          return get_the_excerpt();
        }
      }
    }
    
    // Init Filters to make it all work
    function read_more_filters() {
      add_filter( 'excerpt_more', 'my_auto_excerpt_more' );
      add_filter('get_the_excerpt','my_custom_excerpt_more');
      add_filter('the_excerpt','my_the_excerpt');
    }
    add_action('after_setup_theme','read_more_filters');
    
    

    nm. Got it thanks to this post.

    Here’s the code from it:

    function add_menuid ($page_markup) {
    preg_match('/^<div class=\"([a-z0-9-_]+)\">/i', $page_markup, $matches);
    $divclass = $matches[1];
    $toreplace = array('<div class="'.$divclass.'">', '</div>');
    $new_markup = str_replace($toreplace, '', $page_markup);
    $new_markup = preg_replace('/^
    
      /i', '<ul class="'.$divclass.'">', $new_markup); return $new_markup; } add_filter('wp_page_menu', 'add_menuid');

    I’m working on a twentyten child theme that uses a jquery drop-down nav and am struggling trying to add a class to the surrounding ul element in the main navigation. If I first define a primary navigation menu, then wp_nav_menu() is used to generate the list and I can easily filter it like this:

    function my_wp_nav_menu_args( $args = '' ){
       $args['container'] = false;
       $args['menu_class'] = 'sf-menu';
       return $args;
    }

    Problem is, when twentyten falls back to using wp_page_menu, I can’t pass the arguments I need to get what I want.

    Any ideas how to remove the surrounding div and add a class to the ul nav element?

    Thanks.

    You can add this bit of jquery into the head:

    $(document).ready(function(){
       $('.flickr-thumb a').attr('target','_blank');
    });

    You could of course edit the plugin code too, but that’d be wiped out when you upgrade.

    I got it working this morning (probably about the time of prev post) by systematically turning on/off all js scripts. My enqueue_the_scripts() function is pretty much this:

    wp_enqueue_script('script1','path/to/file',array('jquery'));
    wp_enqueue_script('script2','path/to/file',array('jquery'));
    ...
    wp_enqueue_script('scriptN','path/to/file',array('jquery'))

    and the lightbox came alive when I commented out the enqueue for the theme’s easing script! Coincidentally, I guess I wasn’t using it anyway.

    @dancoulter

    Thanks a lot. You’re right, I don’t need that call anywhere except the home page. I’ll fix that, too. Can’t find it now, but after reading another one of your posts here, [99% of the time its another js breaking lightbox] I was able to narrow it down. Thanks again for such an awesome plugin!

    Getting Close. I wp_enqueue_script‘ed all of the theme-specific scripts, and now instead of just linking to Flickr, the overlay generates and the little loading animation comes up. But that’s where it stops. The animation will play forever and my flickr images will never load in the flightbox.

    The end of my <head> looks like this now:

    wp_enqueue_script(‘jquery’);
    enqueue_the_scripts();
    wp_head();

    If I swap the order of the last 2 lines, it breaks to just linking to flickr. Help!

    Okay, I think I’m gaining on it:

    I noticed for my theme that does not work with lightbox, theme-specific scripts are instantiated with script tags (no php here) and then dumped at wp_head like this:

    <script type="text/javascript" src= ... </script>

    I changed themes back to the one that worked with lightbox, and noticed that theme-specific scripts are called with wp_enqueue_script.

    I’m kind of a php and jQuery n00b, but I’m thinking I need to tweak my broken theme use wp_enque_script instead. I’ll make a backup, change things up, and check back after I do. Meanwhile, any suggestions? Am i on the right track here?

    Firstly, this may be my fav WP plugin ever made. Thanks a ton DanCoulter.

    I’m having similar issues with Lightbox. (I’m thinking it must be theme-related cause it worked wonderfully before I changed it.)

    Any ideas how to troubleshoot? Here’s a page on my site with a broken lightbox flickr gallery: http://eckcite.com/2010/07/ccbar-ranch/ . I’m using this theme: http://wpcrunchy.com/our-themes/obscure

    Thanks in advance. Using flickr-gallery.1.5.2 btw

    Have you looked at your admin panel: Settings >> Discussion ? Is Enable threaded (nested) comments checked?

    Thread Starter alpha_llama

    (@alpha_llama)

    thanks markwhitham!

    <?php echo do_shortcode('[flickr-gallery-shortcode-stuff]') ?> worked perfectly. Had never heard of do_shortcode before now, but it did the trick nicely.

    Try this:

    <blockquote><ul id="PagesAndCategories">
    <?php wp_list_pages( 'title_li=' ); wp_list_categories( 'title_li=' ); ?>
    </ul>
    </blockquote>

    You’ll need to style the ul. (could give it the id for the Cat Nav or the Page Nav.)

    Hope that helps.

Viewing 15 replies - 1 through 15 (of 29 total)