Skip to content

Instantly share code, notes, and snippets.

@rqreyes
rqreyes / add-user.php
Created May 17, 2016 16:43
create a WP admin user
<?php
// Create Admin User
$wp_password = 'PASSWORD'; #enter your desired password here, if you don't line 16 makes sure nothing bad happens like setting you actual password to 'PASSWORD'
$wp_username = 'USERNAME';
$wp_email = 'EMAIL';
if ( $wp_password === 'PASSWORD' )
die;
@rqreyes
rqreyes / .htaccess
Created May 11, 2016 17:13
redirecting from https to http
RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,R=301]
@rqreyes
rqreyes / script.js
Last active October 13, 2017 23:45
smooth scroll
// Select all links with hashes
$('a[href*="#"]')
// Remove links that don't actually link to anything
.not('[href="#"]')
.not('[href="#0"]')
.click(function (event) {
// On-page links
if (
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
&&
@rqreyes
rqreyes / footer.php
Created May 3, 2016 22:16
various wordpress output types
@rqreyes
rqreyes / .htaccess and .htpasswd
Created April 30, 2016 17:28
password prompt
AuthType Basic
AuthName "Members Only"
AuthUserFile /home/randyqre/public_html/fivecyphers.com/.htpasswd
require valid-user
tastemy:$apr1$bahog9Ip$NEmtBppy0FyU9G6wt3nTy0
@rqreyes
rqreyes / header.php
Created April 27, 2016 21:54
output code only on homepage
<?php $Get_url = $_SERVER['REQUEST_URI'];
if ( $Get_url == '/' ) :?>
<link rel="publisher" href="https://plus.google.com/+CirugiaplasticamartinezPe/"/>
<?php endif;?>
@rqreyes
rqreyes / footer.php
Last active April 25, 2016 18:25
output different static footer code on homepage vs interior
@rqreyes
rqreyes / sidebar.php
Last active April 25, 2016 18:27
rendering wordpress shortcode
[cmgForm]
or
<?php echo do_shortcode('[cmgForm]'); ?>
or
<?php
if (! is_page( array( 10 ) )) {
echo do_shortcode('[cmgForm]');
}
?>
@rqreyes
rqreyes / functions.php
Last active April 25, 2016 18:30
cmg wordpress foundation forms
// Contact Page Form
function cmgContactPage($atts) {
return <<< HTML
<div class="contact-page-form">
<form name="contact-page" id="contact-page" autocomplete="off" method="post" action="http://cmgmail.ceatus.com/cmgmail">
<input type="hidden" name="web_form[form_name]" value="__FORM_ID_GENERATED_BY_CERP__"/>
<div class="row">
<div class="large-6 medium-6 columns">
<input type="text" id="first-name" name="web_form[first_name]" placeholder="First Name *" class="contact-first-name" required />
@rqreyes
rqreyes / footer.php
Last active April 25, 2016 18:26
output different footer code on homepage vs interior