This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Fill in your custom taxonomy here | |
$yourTaxonomy = 'CUSTOM_TAXONOMY'; | |
// SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY | |
$category = get_the_terms( $postId, $yourTaxonomy ); | |
$useCatLink = true; | |
// If post has a category assigned. | |
if ($category){ | |
$category_display = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Look at the field called "id" in the result set | |
-- | |
select * from wp_users | |
where user_login = 'WORDPRESS_USERNAME_GOES_HERE'; | |
-- Substitute the above "id" value in the "user_id" field below. | |
-- This is an integer value so do not use quotes around it | |
-- For example if the above "id" is the value 10 then the resulting line would be: where user_id = 10 | |
-- | |
update wp_usermeta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/applications/MAMP/library/bin/mysql -u [USERNAME] -p [DATABASE_NAME] < [PATH_TO_SQL_FILE] | |
Example: | |
/applications/MAMP/library/bin/mysql -u root -p wordpress_db < /Applications/MAMP/htdocs/mydatabase.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myTitles = Array.prototype.slice.apply(document.querySelectorAll("h2.woocommerce-loop-product__title")); | |
const searchTerm = '('; | |
// console.log( myTitles ); | |
const regExp = /\(([^)]+)\)/; | |
myTitles.forEach((myTitles) => { | |
//console.log("apply worked"); | |
if( myTitles.innerHTML.indexOf(searchTerm) > -1 ) { | |
// console.log('yep'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE a,b,c | |
FROM wp_posts a | |
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) | |
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) | |
WHERE a.post_type = 'revision' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Make first word in date underlined | |
* | |
------------------------------------*/ | |
$('.js-first-word').each(function(index, element) { | |
var heading = $(element); | |
var word_array, last_word, first_part; | |
word_array = heading.html().split(/\s+/); // split on spaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Google Captcha v2</title> | |
<script type="text/javascript" language="JavaScript"> | |
// Callback to get the button working. | |
function enableBtn1(){ | |
document.getElementById("button1").disabled = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] |
NewerOlder