This topic is: not a support question

This topic contains 7 replies, has 2 voices, and was last updated by  Randy Lebeau 4 years, 9 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2415

    Randy Lebeau
    Member

    Hey guys,

    What would be the easiest way to get lightbox working for specific show post shortcodes and widgets?

    Does it have something to do with ‘post-class’?

    #2416

    Randy Lebeau
    Member

    or maybe adding $(“a:has(img)”).fancybox(); to functions?

    #2419

    Randy Lebeau
    Member

    $key=”featured_external”; $custom = get_post_meta($post->ID, $key, true);

    That was the answer. Custom field.

    #2421

    themeweaver
    Keymaster
    Post count: 730

    So you have a solution for this?

    #2422

    Randy Lebeau
    Member

    Yes you add a custom field for the url of feature image and have it link directly to the image. Then just use fancybox for wordpress and it will automatically lightbox. The problem was it was a link to the post and not directly to the image.

    #2423

    Randy Lebeau
    Member

    starting at line 48 you would change to this. If you have the featured_external custom field filled out it will link to the specified link. IE. directly to the image or lightbox.


    ID, $key, true);
    if($custom != ''){
    ?>
    <figure id="post-" class="post " >
    <a href="" title="" class="gallery-thumb" rel="bookmark"> trim(strip_tags( $post->post_title ))) ); ?>
    <a href="" title="" rel="bookmark">

    <figure id="post-" class="post " >
    <a href="" title="" class="gallery-thumb" rel="bookmark"> trim(strip_tags( $post->post_title ))) ); ?>
    <a href="" title="" rel="bookmark">

    <?php
    $i++;
    }
    endwhile;

    #2424

    Randy Lebeau
    Member

    In template-gallery-full.php

    #2425

    Randy Lebeau
    Member

    $key=”featured_external”;
    $custom = get_post_meta($post->ID, $key, true);
    if($custom != ”){
    ?>
    <figure id="post-” class=”post ” >

    <a href="” title=”” class=”gallery-thumb” rel=”bookmark”> trim(strip_tags( $post->post_title ))) ); ?>

    <a href="” title=”” rel=”bookmark”>

    <figure id="post-” class=”post ” >

    <a href="” title=”” class=”gallery-thumb” rel=”bookmark”> trim(strip_tags( $post->post_title ))) ); ?>

    <a href="” title=”” rel=”bookmark”>

    <?php
    $i++;
    }
    endwhile;

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

You must be logged in to reply to this topic.