Viewing 15 replies - 1 through 15 (of 34 total)
  • Hi!
    That’s because you don’t seem to be including the shadow-box.js script in your pages.
    In your home, on line 682, you have:

    <script type='text/javascript' src='https://motion-master-templates.com/wp-content/uploads/shadowbox-js/b6872cbe471e004ef0fd479a386bcc99.js?ver=3.0.3'></script>

    But that line is not present in your page’s code.

    Thread Starter deyson

    (@deyson)

    Hello Marventus thank you for the response.

    I see the missing code you pasted above on line 1060 on the test page.

    I made sure to place ‘<?php get_footer(); ?>’ in the end of the page template, as I saw other people solved the problem with that code.
    Maybe I am placing it wrong, please advice.

    Thank you very much for your time.

    I made sure to place ‘<?php get_footer(); ?>’ in the end of the page template

    Did you mean wp_footer? because get_footer() would have no effect if you call it that way.

    Also, you seem to be using the Quick Cache plugin on your site. Try emptying and renewing the cache and see if the script call appears in your footer. If nothing happens, try disabling the plugin.
    Here’s a piece of code to test whether or not wp_footer is working. Paste this in your functions.php file, anywhere between the first </php and last ?> symbols:

    function mmt_footer_test() {
    echo '<p><strong>The footer works!<strong></p>';
    }
    add_action('wp_footer', 'mmt_footer_test');

    Thread Starter deyson

    (@deyson)

    Hello and thank you.

    I have ‘<?php get_footer(); ?>’ in my page template for that page where shadowbox does not work. I have ‘<?php wp_footer(); ?>’ in the footer.

    I disabled the quick cache and I tested the code you send and it showed up.

    Here is the full code for that page template in question:

    <?php
    
    /* Template Name: Filter */
    
    get_header(); ?>
    
    <div class="category_choice">
    <h2>Choose from the following templates.</h2>
    <div class="hspan"></div>
    <div class="sort">Sort:</div>
    <?php filters_generate(); ?></div>
    
       <div id="container">
    
           <div id="content" role="main">
    
               <?php get_template_part( 'loop', 'page' ); ?>
    
               <?php $temp_query = $wp_query; ?>
               <?php query_posts('category_name=&showposts=400'); ?>  
    
               <?php while (have_posts()) : the_post(); ?>  
    
            <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>
    
    <h2></h2>
    <div class="csc_post2">
    <div class="csc_post_title">
    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><h2><?php the_title(); ?></h2></div>
    
    <div class="entry-summary">
    
    <?php the_excerpt(); ?>
    </div>
    </div>
    </div>
    
    <?php endwhile; ?>  
    
    </div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_footer(); ?>

    Thank you for looking into this ??

    I have ‘<?php get_footer(); ?>’ in my page template

    Sorry, my bad. That is the correct way of doing it. I thought you meant you had get_footer() instead of wp_footer in your footer.php file. I’ll take a look at the code you posted.
    On a different note, when pasting more than 10 lines of code, you are supposed to use Pastebin as per forum guidelines. That way, threads are easier to read and don’t get bloated.
    Thanks!

    Plugin Author Matt Martz

    (@sivel)

    Shadowbox does appear to be loaded on the page correctly. However none of the links contain rel="shadowbox" on them. As such shadowbox will never try to open them. I see some of the URLs are for .mov files, and in general the shadowbox plugin should add them, unless the automation is disabled or your theme is not processing things appropriately.

    You could always add rel=”shadowbox” manually to the links. One other thing to note, is it looks like you are also attempting to use some other type of lightbox plugin (lightview) which could be interfering.

    Thread Starter deyson

    (@deyson)

    Hello Marventus, sorry about the bloating ??
    Here is the pastebin link: https://pastebin.com/7jEGfATm

    Hello Matt. ??
    The automation is enabled and the same excerpts are working on my home page:
    https://motion-master-templates.com/

    I would love to avoid having to add a rel=shadowbox to all my excerpts.

    In regards to lightview. I removed the code and I still get the same results. I was playing with a future way of presenting my lightbox like this: https://motion-master-templates.com/test-page-shadowbox with inline text.
    I am not sure if shadowbox could achieve the same result though.

    @matt: You are absolutely right. Thank you for pointing that out.

    @deyson: After reading Matt’s comment, I think I know what the issue might be:
    In the page where shadowbox is not working, your rel attributes are being included with the “bookmark” value instead the proper shadowbox values.
    Since shadowbox is now loading in your pages, I can only think of 2 reasons why that could be happening:
    1. The shadowbox value is being overwritten by the other one (through a plugin or theme feature);
    2. The shadowbox plugin is checking for the existence of a rel attribute, and since it is finding one, it does not add its own.
    You should try to find where and how that rel="bookmark" code is being generated and you’ll most likely solve the problem.

    Thread Starter deyson

    (@deyson)

    I have rel=“bookmark” inside the page template code like this (part of the code), the full code is linked above.:

    <div class="csc_post2">
    <div class="csc_post_title">
    <a>" rel="bookmark" title="<?php the_title(); ?>"><h2><?php the_title(); ?></h2></div>
    
    <div class="entry-summary">
    
    <?php the_excerpt(); ?>
    </div>
    </div>
    </div>

    What happens if you remove the:

    rel="bookmark"

    chunk? Dos the shadowbox plugin work then?

    Edit: You also seem to have some HTML errors in your page code. Check this out:

    <h2></h2>
    <div class="csc_post2">
    <div class="csc_post_title">
    <a href="https://motion-master-templates.com/member-templates/tablet" rel="bookmark" title="Tablet"><h2>Tablet</h2></div>

    On line 1, you have an empty <h2> tag, and on line 4, the <a> tag opened at the beginning is never closed.

    Thread Starter deyson

    (@deyson)

    I removed the <h2></h2>. I removed the rel=“bookmark” and I closed the tag with an . and shadowbox still does not work. ??

    Any more ideas?

    Thank you again for all your time I am very grateful. ??

    Thread Starter deyson

    (@deyson)

    Hello. I also discovered that on my search results the shadowbox is not working either. So maybe it is not the page template that is causing the error: https://motion-master-templates.com/?s=final&submit=Search

    Thank you. ??

    Thank you again for all your time I am very grateful. ??

    No problem: I’m stubborn like that, ??

    Your HTML seems fine now so it should be working. I have two ideas:
    1. Test a different lightbox plugin see if the issue lies with the shadowbox plugin or your theme;
    2. Force the “rel” stuff from your templates, by changing this:

    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">

    to this:

    <a href="<?php the_permalink() ?>" rel="bookmark shadowbox[sbpost-<?php echo $post->ID ?>];width=848;height=480" title="<?php the_title(); ?>">

    For option 2, if you don’t want to hardcode the width and height of the shadowbox and want to keep it dynamic, you could use a custom field for each value, and then test if those values are set, and if they are not, just go with the regular size of 848*480.

    Thread Starter deyson

    (@deyson)

    Any other lightbox you may want to recommend I try out, since there are so many out there? ??

    The thing with the code above is that it pertains to the title of the excerpt that links to the actual post and not the excerpt content itself which is what is holding the shadowbox item. When I changed the code it made the gray area blank.

    The weird thing is that the search results worked before with the shadowbox. Now I have no clue what may have broken it.

    Thank you ??

    Any other lightbox you may want to recommend I try out, since there are so many out there? ??

    We have Fancybox2 (jQuery-based) running in one of your sites: it works pretty well. and it has a lot of options.

    The thing with the code above is that it pertains to the title of the excerpt

    You are right, sorry about that. Could you go back to your Pastebin and create a new version of this paste with the latest changes to your code?

    The weird thing is that the search results worked before with the shadowbox.

    Did you change any options or made changes to your search templates? It seems you might have to run some tests as well, perhaps with an unmodified/earlier version of your theme?

Viewing 15 replies - 1 through 15 (of 34 total)
  • The topic ‘[Plugin: Shadowbox JS] Shadow Box not working on some pages’ is closed to new replies.