Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    Hi,

    If you are logged in to WordPress, I think it’s hiding in the caption bar of the management screen.

    Thread Starter wpwood3

    (@wpwood3)

    I have “captionEl” set to “true” in Boxers and Swipers settings for PhotoSwipe.
    What else needs to be done?

    As I said, my captions show up just fine in Colorbox and Image Lightbox.

    Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    Hi,

    It’s also work in my environment. I have received a report that also work in other environments.
    In your environment, please try to stop the other plug-ins or try to change the theme.

    Max

    (@maxirider)

    Плагин PhotoSwipe использует title для формирования Caption. Но title не формируется в коде ссылки.
    Для формирования title необходимо дописать код, аналогичный тому, что формирует title для других плагинов.
    В файле inc/BoxersAndSwipers.php в функции add_anchor_tag_content
    находим код:
    else if ( $this->effect === ‘photoswipe’ ) {
    //photoswipe
    $rel_name = ‘ rel=”boxers-and-swipers”‘;
    $class_name = ‘ class=”boxersandswipers”‘;
    $link = str_replace($value, $rel_name.$class_name.$value, $link);
    }
    и меняем на:
    else if ( $this->effect === ‘photoswipe’ ) {
    //photoswipe
    $rel_name = ‘ rel=”boxers-and-swipers”‘;
    $class_name = ‘ class=”boxersandswipers”‘;
    $titlename = NULL;
    foreach ( $this->attachments as $attachment ) {
    if( strpos($value, get_post_meta( $attachment->ID, ‘_wp_attached_file’, true )) ){
    $titlename = ‘ title=”‘.$attachment->post_title.'”‘;
    }
    }
    $link = str_replace($value, $rel_name.$class_name.$titlename.$value, $link);
    }

    После этого Captions должны показываться.
    Версия плагина – 2.33.

    Thread Starter wpwood3

    (@wpwood3)

    Thank you Max!
    Your suggested code fixed the problem with this plugin. Captions now appear in PhotoSwipe.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PhotoSwipe not showing image captions’ is closed to new replies.