Skip to content

Instantly share code, notes, and snippets.

View Edwardtonnn's full-sized avatar
🎯
Focusing

Edward Edwardtonnn

🎯
Focusing
  • Los Angeles Web Club
  • South Gate, CA
View GitHub Profile
<?php
Follow directions @ https://www.sitepoint.com/wordpress-svg/
<?php
add_action ('wp_enqueue_scripts', 'load_custom_styles');
function load_custom_styles() {
wp_enqueue_style(
'custom',
get_template_directory_uri() . '/css/custom.css'
);
wp_enqueue_script(
@Edwardtonnn
Edwardtonnn / functions.php
Created September 18, 2018 22:07
Slick Slider
<?php
// Drop Slick Slider files inside of js folder and add the following to your functions.php
//Slick Slider JS
add_action('wp_enqueue_scripts', 'load_slick', 5);
function load_slick(){
// Slick Slider JS
wp_enqueue_script(
'slick',
get_stylesheet_directory_uri() . '/js/slick/slick.js',
@Edwardtonnn
Edwardtonnn / .htaccess
Created September 25, 2018 19:28
rewrite site to subsolder
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain-name.com$
RewriteCond %{REQUEST_URI} !folder/
RewriteRule (.*) /folder/$1 [L]
In the above lines you should replace the following:
domain-name.com - Type your own domain name
folder - Type the name of the subfolder which has the test/development website
-- https://digwp.com/2010/03/remove-replace-content-wordpress-database/
UPDATE wp_posts SET post_content = REPLACE ( post_content, 'nofollow ', 'dofollow ' );
@Edwardtonnn
Edwardtonnn / index.js
Created October 2, 2018 13:44
update records
// Setup
var collection = {
'2548': {
album: 'Slippery When Wet',
artist: 'Bon Jovi',
tracks: ['Let It Rock', 'You Give Love a Bad Name'],
},
'2468': {
album: '1999',
artist: 'Prince',
@Edwardtonnn
Edwardtonnn / functions.php
Created October 10, 2018 17:57
Remove paragraph tags from automatically wrapping around wp text
<?php
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
@Edwardtonnn
Edwardtonnn / index.mysql
Created October 11, 2018 19:24
Search and Replace wp site using mysql
UPDATE wp_options SET option_value = replace(option_value, 'Existing URL', 'New URL') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'Existing URL', 'New URL');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'Existing URL','New URL');
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'Existing URL','New URL');
UPDATE wp_links SET link_url = replace(link_url, 'Existing URL','New URL');
@Edwardtonnn
Edwardtonnn / function.php
Created October 25, 2018 17:46
Search Form for WP
<?php
<div class="search-field">
<?php get_search_form(); ?>
</div>
@Edwardtonnn
Edwardtonnn / functions.php
Created October 29, 2018 16:49
Add shortcode to sidebar widget area
<?php
<!-- Add shortcode to sidebar widget area -->
add_filter( 'widget_text', 'do_shortcode' );