Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Linking a script in WordPress

Featured Replies

I've used a script/code, which links and allows you show your latest pictures in Flickr

(see example from my test site Flickr link - test page

 

The script and link to script file has to go in the header and this works fine in the dedicated html page.

 

Now to my problem ...

 

I'm playing with WordPress and want to integrate this code into a WP page. I've put the code into the header.php file and it works :)

 

However, there is a conflict with other pages that use the "lightbox" - instead of opening the lightbox, it opens a new tab

 

After a bit of investigation, the problem is the link to the js file

 

<script type="text/javascript" src="script/jquery-1.2.6.min.js"></script>

 

Is there a way around this problem?

 

p.s. I don't have the Flickr code in the blog just now as I want the lightbox working

The link should be fine, what's telling you it's that link and what are the errors?

 

Often a mistake in the code will cause firebug to throw up errors within the jquery file, when that's not the actual cause of the fault.

 

I'm assuming that the flickr script, and lightbox work fine standalone, so it's obviously a code conflict.

 

Have you got a link to an example page with both on?

  • Author

Cheers bocaj

 

The problem is that it doesn't give any errors - it's just the functionality of the lightbox that is affected (as described in my 1st post).

 

To investigate the problem - the page is edited in the WP editor and it was a case of removing the lines of code and retrying it till it broke

  • Author

I've installed Firebug (fantastic tool )

 

With no Flickr code in, Firebug does not show any errors. However, when I put the code in, it throws up errors in the prototype.js and lightbox.js files

 

the flickr code is currently in if you want to look Flickr page Lightbox page

  • Author

Cracked it :D :D

 

Here is my solution

 

  1. Create a file with your code - save as .php
  2. Modify your header.php with an if statement to include your new php file - (see code below)

 

<?php
// add code for individual page

if (is_page('xx')){
include(TEMPLATEPATH.'/yourfile.php'); 
}
?>

 

Note - is_page('xx'), where xx can be any of

  1. page title
  2. page slug
  3. page ID

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.