• Skip to main content
  • Skip to primary sidebar

Victor Font Consulting Group, LLC

The DEX Intranet Specialists

  • Home
  • Care Plans
    • Care Articles
    • Optional Subscriptions
  • Consultations
  • Products
    • Code Snippets
    • Public GitHub Repositories
    • Gist Snippets
    • Pastebin Snippets (Free)
    • Free Plugins
  • FAQs
  • Support
    • Graphic Design
  • Contact
    • Speakers
    • Portfolio
  • Resources
    • Free WordPress Video Training
    • Tutorials
    • Articles
    • Cybersecurity
    • EU Referral Network

Using ThickBox with a Hyperlink on a WordPress Post or Page

August 20, 2011 By Victor M. Font Jr.

Thickbox Example

There are quite a few default scripts installed along with WordPress including Scriptaculous, jQuery and ThickBox to name just a few. For a recent job, I needed to include a popup of member details, driven off of a dynamically created hyperlink. As I searched WordPress.org for a solution, I came across a Function Reference for the wp_enqueue_script. I was intrigued to learn that ThickBox was delivered with WordPress, so I started looking for ThickBox related plugins. There are many of them, but I couldn’t find any that worked through dynamic hyperlinks. They all seemed to use short codes in posts or pages.

Using ThickBox with dynamic hyperlinks is actually very simple. It’s so simple, it’s easier than installing a plugin. It requires modifying your theme’s functions.php file. To do this, open functions.php in the theme editor and add the following code at the bottom of the file:

Save the file and you’re done. Next, when you construct your hyperlink, include a class=’thickbox’ in the declaration.


To understand how the displaycode.php program works, see Raising the WP eMember Public Directory Bar to the Next Level.

  • 0shares
  • Facebook0
  • Twitter0
  • Pinterest0
  • LinkedIn0
  • Print
  • SMS0

Filed Under: Code Snippet, Computers and Internet, Programming, WordPress Tagged With: Code Snippet, PHP, Programming, WordPress

About Victor M. Font Jr.

Victor M. Font Jr. is an award winning author, entrepreneur, and Senior IT Executive. A Founding Board Member of the North Carolina Executive Roundtable, he has served on the Board of Advisors, of the North Carolina Technology Association, the International Institute of Business Analysis, Association of Information Technology Professionals, Toastmasters International, and the North Carolina Commission for Mental Health, Developmental Disabilities, and Substance Abuse Services. He is author of several books including The Ultimate Guide to the SDLC and Winning With WordPress Basics, and Cybersecurity.

Primary Sidebar

Shopping Cart

Books

  • Winning With WordPress Basics 2nd Edition Winning With WordPress Basics 2nd Edition $19.95
  • Ultimate Guide to the SDLC front cover The Ultimate Guide to the SDLC
    Rated 5.00 out of 5
    $74.95

Recent Articles

  • Modern Scam Defense: How Consumers and Businesses Can Recognize and Stop Email, Phone, and Text Fraud
  • How to Write a PRD So Dense It’s Technically a Novel
  • Top 5 Plugin Names That Scare Our Legal Department
  • When Agile Meets Our 3-Year Waterfall Roadmap: A Love Story
  • Why Our Enterprise Needs 27 Stakeholders to Approve a Button Color Change

Top 10 Article Categories

Best Practice Code Snippet Computers and Internet Genesis How To Leadership Programming Servant Leadership Tutorial WordPress

 
We only use analytical cookies on our website that allow us to recognize and count the number of visitors, but they do not identify you individually. They help us to improve the way our website works. By clicking Accept you, agree to cookies being used in accordance with our Cookie Policy.