Skip to content
  • Blog (1)
  • About Us
  • Tags
  • Donations
1SMARTchicken - Code Made Easy
  • Tutorials (183)
  • Reference (2172)
  • Snippets (69)

Category: Snippets

1SMARTchicken - Code Made Easy

Category: Snippets

  • Tutorials (183)
  • Reference (2172)
  • Snippets (69)
  • Blog (1)
  • About Us
  • Tags
  • Donations
1SMARTchicken - Code Made Easy
  • Tutorials (183)
  • Reference (2172)
  • Snippets (69)
1SMARTchicken - Code Made Easy

Category: Snippets

  • Tutorials (183)
  • Reference (2172)
  • Snippets (69)
  • Home
  • Snippets
  • Page 2
jQuery Snippets

jQuery – Add a _blank Target Attribute to PDF Links

July 27, 2024 / jQuery Snippets, Snippets / Link

Depending on the browser being used and its settings, a PDF link may open by default in the same tab/window. But jQuery can change that behavior.

jQuery Snippets

jQuery – Create a Print Page Button

July 27, 2024 / jQuery Snippets, Snippets / Link, Print

Using jQuery, a “print page” link can be created on the page which will open the browser’s print dialog box when clicked.

jQuery Snippets

jQuery – Add a nofollow to Specific Sets of Links

July 27, 2024 / jQuery Snippets, Snippets / Link

You may have a set of links setup to outside sources or even as affiliate links. jQuery can be used to automatically set those links to nofollow for SEO.

jQuery Snippets

jQuery – Create a Reload Page Button

July 27, 2024 / jQuery Snippets, Snippets / Link

Using jQuery, a “reload page” link can be created on the page which will allow the user to reload the page when clicked.

jQuery Snippets

jQuery – Disable a Text Link

July 27, 2024 / jQuery Snippets, Snippets / Link, Text

There are times where you may want/need to disable a text link or set of links on your sites temporarily using jQuery.

jQuery Snippets

jQuery – Hide Specific Elements Until the Page has Loaded

July 27, 2024 / jQuery Snippets, Snippets

There are times when you only want specific elements of your site to show AFTER the page has finished loading. For instance, a heavy hero-image section.

jQuery Snippets

jQuery – Smooth Scroll to a Page Anchor

March 9, 2025 / jQuery Snippets, Snippets / Animation, Link

Using the jQuery animate() method, a link clicked can smoothly scroll down (or up) the page to a page anchor.

jQuery Snippets

jQuery – Smooth Scroll Back to Top Button

July 28, 2024 / jQuery Snippets, Snippets / Animation, Link

Some sites place a smooth-scrolling, back-to-top button in the lower, right-hand corner of the site so the user can get back to the page top easily.

PHP Snippets

PHP – Redirect a Page

March 9, 2025 / PHP Snippets, Snippets

The PHP yield from keyword is used to create a generator function which acts as iterators which can be looped through with a foreach loop.

SQL Snippets

SQL – Select, Order, and Limit Specified Entries from a Table

July 26, 2024 / Snippets, SQL Snippets / Keyword

A typical SELECT statement will include WHERE, ORDER BY, and LIMIT keywords to retrieve only the rows that apply.

SQL Snippets

SQL – Show all Databases on the Server

July 26, 2024 / Snippets, SQL Snippets / MySQL, SQL Server

This shows all databases on the server, and is handy when looking for a specific database in the system or if you’re acclimating yourself to a new system.

SQL Snippets

SQL – Show all Tables in the Current Database

July 26, 2024 / Snippets, SQL Snippets / MySQL, SQL Server

This will display a list of all the tables in the current database.

Python Snippets

Python – Getting a Simple Random Number

August 10, 2024 / Python Snippets, Snippets / Number

Python does not have a random() function to make a random number, but does have a built-in module called random that can be used to make random numbers.

WordPress Snippets

WordPress – Add a Clear Cart Button to WooCommerce

January 28, 2025 / Snippets, WordPress Snippets / WooCommerce

When a user is in the WooCommerce checkout, they’ll find that the “Ship to a Different Address” box checked is by default.

WordPress Snippets

WordPress – Add a Custom User Avatar

July 30, 2024 / Snippets, WordPress Snippets / Backend, Image

In the discussion settings of WordPress sites a custom avatar can be placed that can be used by the users on your site when joining to place comments.

WordPress Snippets

WordPress – Add a Page Title to All Page/Post Types

January 29, 2025 / Snippets, WordPress Snippets / Shortcode

There are times when you may need a shortcode to add the current page or post title somewhere on your site.

WordPress Snippets

WordPress – Add an Excerpt to WooCommerce Grid Items

July 30, 2024 / Snippets, WordPress Snippets / WooCommerce

When using WooCommerce on a WordPress site, you can show the products on the shop page as a grid, but not all themes show the product’s short description.

WordPress Snippets

WordPress – Add an Excerpt Widget to the Backend of Pages

July 30, 2024 / Snippets, WordPress Snippets / Backend

The backend of a WordPress site has pages, post, etc. But on the pages, there is no area for writing a short description. This code adds that functionality.

WordPress Snippets

WordPress – Add Post Counts to Menu Category Links

July 30, 2024 / Snippets, WordPress Snippets / Link

The number of posts contained in each WordPress category (post count) can be displayed in the main menu when using categories as links.

WordPress Snippets

WordPress – Break a Site Out of Another URL’s Frames

July 30, 2024 / Snippets, WordPress Snippets / Link, Security

There have been times where I’ve found that one of my sites was showing completely under another individual’s URL. They embedded my site in their frames.

← Previous 1 2 3 4 Next →

or View All Tags

Tutorials

  • HTML Tutorials (40)
  • CSS Tutorials (45)
    • CSS Flexbox (12)
  • JavaScript Tutorials (6)
  • jQuery Tutorials (13)
  • PHP Tutorials (0)
  • SQL Tutorials (0)
  • Python Tutorials (79)
    • Python File Handling (4)
    • Python and MySQL (11)
  • WordPress Tutorials (0)

Reference

  • HTML Reference (244)
    • HTML Tags (107)
    • HTML Attributes (46)
    • HTML Events (76)
    • HTML Resources (15)
  • CSS Reference (309)
    • CSS Selectors (55)
    • CSS Properties (220)
    • CSS Functions (17)
    • CSS Resources (17)
  • JavaScript Reference (555)
    • JavaScript Selectors (7)
    • JavaScript Operators (12)
    • JavaScript Statements (17)
    • JavaScript Methods (284)
    • JavaScript Properties (162)
    • JavaScript RegExp (45)
    • JavaScript Resources (28)
  • jQuery Reference (220)
    • jQuery Selectors (54)
    • jQuery Methods (140)
    • jQuery Ajax Methods (16)
    • jQuery Properties (17)
    • jQuery Resources (9)
  • PHP Reference (460)
    • PHP Keywords (59)
    • PHP Functions (400)
    • PHP Constants (0)
    • PHP Resources (1)
  • SQL Reference (290)
    • SQL Keywords (59)
    • MySQL Functions (138)
    • SQL Server Functions (83)
    • SQL Resources (10)
  • Python Reference (94)
    • Python Methods (86)
    • Python Resources (8)
  • WordPress Reference (0)

Snippets

  • HTML Snippets (3)
  • CSS Snippets (12)
  • JavaScript Snippets (5)
  • jQuery Snippets (8)
  • PHP Snippets (1)
  • SQL Snippets (3)
  • Python Snippets (1)
  • WordPress Snippets (36)
1SMARTchicken - Code Made Easy

333 Washington Blvd.
Suite 126
Marina del Rey, CA 90292
United States

contact2025@1smartchicken.com

  • About Us
  • Privacy Policy
  • Cookie Policy
  • Terms & Conditions

Search for Code:

or View All Tags

Copyright © 2025 1SMARTchicken | All Rights Reserved.