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 | |
// put this in header.php | |
if (!is_user_logged_in()) { | |
wp_redirect( 'https://www.yourdomain.com'); | |
exit; | |
} ?> |
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 | |
// echo relevant directory ~mj | |
function print_dir($type) { | |
if($type === '') | |
$dir = get_template_directory_uri(); | |
else if ($type === 'js') | |
$dir = get_template_directory_uri() . '/public/js/'; | |
else if ($type === 'css') |
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 | |
// When manually inputting shortcodes in WordPress themes with do_shortcode() i like to | |
// do a if (function_exists()) just in case something breaks. | |
// The plugin AJAX Search Lite didn't have anything in the documentation regarding what function | |
// is actually called so i had to look for it in the plugin files; it took 20 seconds. | |
// Figured this would help to save you 20 seconds. Cheers and peace ~mj | |
if( function_exists('wd_asl')) { | |
echo do_shortcode('[wpdreams_ajaxsearchlite]'); |
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 | |
/* Move Yoast to bottom of Dashboard editor*/ | |
function yoast_to_bottom() { | |
return 'low'; | |
} | |
if ( defined('WPSEO_VERSION')) | |
add_filter( 'wpseo_metabox_prio', 'yoast_to_bottom'); |
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
/* Color code posts by "Status in Dashboard ~mj */ | |
function mj_color_code_posts_by_status() { | |
?> | |
<style> | |
.status-draft { background-color: #ffff99 !important; } | |
.status-future { background-color: #ccff99 !important; } | |
.status-pending { background-color: #87c5d6 !important; } | |
.status-private { background-color:#ffcc99; } | |
.status-publish { background-color: #fff !important; } |
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
// for the JS file that needs theme images | |
// append rest of directory | |
// could add multiple variables if wanted inside array | |
// ~mj | |
wp_localize_script( | |
'main', // $handle | |
'WPURLS', | |
array( | |
'siteurl' => print_dir('images') // instead of custom function print_dir(), you can put the path of your images directory |
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
// So I needed to change the position of the floating widget on mobile for my site since | |
// I have a fixed footer navbar. After not seeing any controls in the .js file, figured i'd just override it | |
// via CSS. Here you go. | |
// (Yes, using '!important' is crappy, but it was necessary to get this done.) ~mj | |
@media screen and (max-width: 768px) { | |
body .userway.userway_p3 { | |
bottom: 65px!important; | |
} | |
} |
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
{% comment %} | |
Source: https://gist.github.com/carolineschnapp/9122054 | |
If you are not on a collection page, do define which collection to use in the order form. | |
Use the following assign statement, replace 'your-collection-handle-here' with your collection handle. | |
{% assign collection = collections.your-collection-handle-here %} | |
Use the assign statement outside of this comment block at the top of your template. | |
{% endcomment %} | |
{% paginate collection.products by 100 %} |
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
#mc_embed_signup form{text-align:center;padding:10px 0}.mc-field-group{display:inline-block}#mc_embed_signup input.email{font-family:"Open Sans","Helvetica Neue",Arial,Helvetica,Verdana,sans-serif;font-size:15px;border:1px solid #ABB0B2;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;color:#343434;background-color:#fff;box-sizing:border-box;height:32px;padding:0 .4em;display:inline-block;margin:0;width:350px;vertical-align:top}#mc_embed_signup label{display:block;font-size:16px;padding-bottom:10px;font-weight:700}#mc_embed_signup .clear{display:inline-block}#mc_embed_signup .button{font-size:13px;border:none;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;letter-spacing:.03em;color:#fff;background-color:#aaa;box-sizing:border-box;height:32px;line-height:32px;padding:0 18px;display:inline-block;margin:0;transition:all .23s ease-in-out 0s}#mc_embed_signup .button:hover{background-color:#777;cursor:pointer}#mc_embed_signup div#mce-responses{float:left;top:-1.4em;padding:0 .5 |
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
!function(e,t){"use strict";function n(e){var t=e.length,n=K.type(e);return!K.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)))}function r(e,n,r,i){if(K.acceptData(e)){var a,o,s=K.expando,u="string"==typeof n,l=e.nodeType,c=l?K.cache:e,d=l?e[s]:e[s]&&s;if(d&&c[d]&&(i||c[d].data)||!u||r!==t)return d||(l?e[s]=d=$.pop()||K.guid++:d=s),c[d]||(c[d]={},l||(c[d].toJSON=K.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[d]=K.extend(c[d],n):c[d].data=K.extend(c[d].data,n)),a=c[d],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[K.camelCase(n)]=r),u?(o=a[n],null==o&&(o=a[K.camelCase(n)])):o=a,o}}function i(e,t,n){if(K.acceptData(e)){var r,i,a,s=e.nodeType,u=s?K.cache:e,l=s?e[K.expando]:K.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){K.isArray(t)?t=t.concat(K.map(t,K.camelCase)):t in r?t=[t]:t=(t=K.camelCase(t))in r?[t]:t.split(" ");for(i=0,a=t.length;a>i;i++)delete r[t[i]];if(!(n?o:K.isEmptyObject)(r))return}(n||(delete u[l].data,o(u[l])))&&(s?K.cleanData([ |