Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1071753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:45:20+00:00 2026-05-16T20:45:20+00:00

I am trying to create a gallery through a plugin I am making but

  • 0

I am trying to create a gallery through a plugin I am making but am getting a javascript error and cant figure out why. Below is my code any help would be greatly appreciated. Here is where I have implemented it. http://findlegalanswers.com/?page_id=4

<?php
/*
Plugin Name: iPad and iPhone Swipe Gallery
Version: 1.0
Plugin URI: http://www.prototypesyndicate.com
Description: Adds a great simple looking gallery to your pages or post with iPhone and iPad swipe. For more information on how to setup view documentation in plugin folder
Author: Alex Gonzalez - Vinas
Author URI: http://www.prototypesyndicate.com
*/


    function jquery_load_gallery_header() {
        echo "<script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js\" type=\"text/javascript\"></script>" . "\n";
        echo "<script src=" . get_bloginfo('wpurl') . "/wp-content/plugins/iPad_iPhone_Gallery/js/jquery.touch-gallery-1.0.0.js\"></script>" . "\n";
    }

    function simpleslide_load_ready()
    {
        echo "<style type=\"text/css\">

        #content {
            padding: 50px 0 0 0;
            width: 600px;
        }
        #gallery {
            width: 300px;
            overflow: hidden;
        }
        #gallery div,
        #gallery a {
            display: block;
            float: left;
            color: #fff;
            width: 75px;
            height: 75px;
            margin: 0 8px 8px 0;
        }

            </style>";
    }

add_action('wp_head', 'jquery_load_gallery_header');
add_action('wp_head', 'simpleslide_load_ready');


//album [album category="flickr_url"] [/album]
function mAlbum( $atts, $content = null ) {

   extract( shortcode_atts( array(
      'flickr' => 'Featured',
      ), $atts ) );

    ob_start();
    ?>

    <div id="content">
        <div id="gallery">
        </div>
    </div>

    <script>
        $(function() {
            $.getJSON("http://api.flickr.com/services/rest?method=flickr.photosets.getPhotos&api_key=ed144a125aca366df3438c58c0c0ec9d&photoset_id=72157624601158052&extras=url_sq,url_m,url_o,&format=json&jsoncallback=?", function(data) {
                $.each(data.photoset.photo, function(i) {
                    $('<div>').append($('<img>').attr('src', this.url_sq)).data('flickr', this).appendTo('#gallery');
                });
                $('#gallery div').touchGallery({
                    getSource: function() {
                        var f = $(this).data('flickr');
                        return f.url_o || f.url_sq.replace('_s.', '_b.');
                    }
                });
            });

        });
    </script>


<?php   

    $content = ob_get_contents();
    ob_end_clean();
    return $content;

}

// Adds shortcode to use in pages or post. 
add_shortcode('album', 'mAlbum');


?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:45:20+00:00Added an answer on May 16, 2026 at 8:45 pm

    I blame a polluted ‘wpurl’ return. Guessing that there is a space at the end in your blog title setting which got urlencoded into a bizarre destination. Thus, web browser looked for:

    http://blabla%20/wp-content/…

    At any rate, browser is thrown off that way. Check your blog title, trim the spaces or otherwise hardcode (for better or worse) the entire URL as needed.

    Culprit line:

    echo "<script src=" . get_bloginfo('wpurl') . "/wp-content/plugins/iPad_iPhone_Gallery/js/jquery.touch-gallery-1.0.0.js\"></script>" . "\n";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.