Browsing "CMS Frameworks"
Sep 8, 2017 - jQuery, WordPress    Comments Off on JS for iconifying menu tiems

JS for iconifying menu tiems


$('li.menu-item.icon').each(function(){
var cont = $(this);
var list = $(this).attr('class').split(/\s+/);
var link = $(this).find('a');
console.log(list);
$.each(list, function(index, item) {
console.log(item);
if (item.match(/fa-(.*)/)) {
//do something
link.addClass('fa');
link.find('span').addClass('screen-reader-text');
link.addClass(item);
cont.removeClass(item);
}
});
});

Sep 7, 2017 - WordPress    Comments Off on URL change 301 RegEx

URL change 301 RegEx

If you do decide to get rid of dates in your permalink structure, you can add the following redirect to your .htaccess file (if you’re on Apache) to ensure that the old URL (/yyyy/mm/dd/%postname%/) points to the new one:

RedirectMatch 301 /d{4}/d{2}/d{2}/(.*) https://yoast.com/$1
For Nginx, you can use the following snippet in your site configuration:

location ~ /d{4}/d{2}/d{2}/(.*) {
rewrite ^(.*)$ https://yoast.com/$1 permanent;
}

from https://yoast.com/wordpress-seo-url-permalink/

May 18, 2016 - CSS, WordPress    Comments Off on Style test page

Style test page

This is a block of body copy. This block of body copy is here to give an idea of what body copy might look like with regards to texture and style. This is the primary style for the website copy, and all other copy is a variable from this style. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Just so that we have a baseline, this is what some italic text would look like inline. This is how we will style bold text. And there are rare instances where we may include both bold and italic on one element. We will also want to link some pages to other pages. I don’t know why, but some people still have a fondness for underlining content. I find this odd.

This is a content H1 tag

H1 tags are useful for SEO maintenance, but should be used very sparingly. The primary H1 tag on any page should be the title, generated by WordPress.

This is a content H2 tag

Likewise, H2 tags should be used sparingly in copy. The primary H2 tag for any page should be the subtitle and/or the site title. However, there are times when content copy hold a major import and should be drawn out both visually and for SEO.

This is a content H3 tag

This is a content H4 tag

The H3 & H4 tags are your primary ways to differentiate body copy as important without overriding the SEO goodness built by your page title and subtitle. Use with gusto and good judgement.

This is a content H5 tag
This is a content H6 tag

The last two heading types, H5 & H6 are good fall-back differentiators. Often, H5 resembles bolded content and H6 resembles plain content. Keep in mind that both are block elements (they will go on their own line) and that they are informative to SEO.

Preformatted content is rarely used except in situations of documentation. It is primarily for setting
aside things like code to be executed and/or commands to be typed. Unlike standard content, it will not
automatically "break" at a certain line length and <strong>must</strong> have explicit line breaks inserted.

Blockquotes are a great way to set very specific content out as either a “pull” from the primary content or as a quote from a specific individual. These can be useful for both hierarchical and design reasons.

– Catherine OBrien

Sometimes it is useful to create a bullet list:

  • For brief information
    • And the sub-items of that information
  • For a visual break
  • To outline basics before going more in-depth
  • For an actual list of items

Sometimes, an ordered list is more appropriate:

  1. To outline specific steps to take in process
  2. Defining items in order of importance
  3. To create an old-school content outline
    1. In which case you may have subitems
  4. As a table of contents

As you can see, there are many options to consider when styling body content in WordPress, and many options to use.

Here is an export file to use to import this page into a WordPress install so that you don’t have to write all this up. It includes some fields that are specific to my code, but otherwise, you might find it useful.

Aug 27, 2015 - Hosting Headaches, WordPress    Comments Off on Goddamn hackers

Goddamn hackers

find . -name '*.php' -print > badfile.txt
vi badfile.txt
:s%/.\//rm -f .\/

grep -H -r -l '\$sF\=' /path/to/dir/to/check/ > badfile.txt

Jul 1, 2015 - git, PlugIns    Comments Off on Gitting around git issues

Gitting around git issues

Sometimes I have a plugin in version control, for reasons of naming or maintenance, or whatever, and I forget that and use WP to update the plugin. Here’s how to fix it quickly on the remote site:

git fetch --all
git reset --hard origin/master
Dec 18, 2014 - Genesis, Notes, PlugIns, WordPress    Comments Off on MSDLAB Toolkit

MSDLAB Toolkit

This is what I use for most of my WordPress Sites. The GitHub repository has most of the custom stuff that I use over and over. Generally speaking, I simply customize as needed per client. Not the “properest” way to do it, but faster and more cost effective for the client. Sometimes I do a major update when I find myself doing very similar customizations over and over.

Themes

Genesis Framework

Mad Science themes are built as child themes for the Genesis framework by StudioPress. Genesis themes work differently from other WordPress themes, because they rely strongly on hooks and actions. These two important keywords can take a bit of fiddling with to wrap your head around, but they are built into every part of WordPress, and once you understand them, they make it very simple to customize layout, activity, and even functionality of a WordPress site.

There are some nice reference sites for Genesis. I find myself going back to the visual hook guide frequently, as well as other areas of Genesis Tutorials.

You will need to install the Genesis theme on any site that you will be installing a genesis child theme.

MSDLAB Starter Theme

A Genesis starter theme with Twitter Bootstrap & Font Awesome support using LESS. On GitHub. Copy and rename to use.

Plugins

Premium Plugins

Custom Plugins

The GitHub repository has a number of customized plugins. The one that is used on almost every site I do is MSD Site Settings. The others are mostly customizations of existing plugins. As I have time I am making them into “child plugins” so that they don’t need to be updated every time a source plugin is updated.

Plugin Directory Plugins

Can be found as favorites under my username, Foxydot. I don’t use all of these on every site, obviously, but these are ones I use often and trust.

Tools

The one tool I rely on quite a bit is WPAlchemy. There is a copy in the GitHub repository, at the WP_CONTENT_DIR level, because that’s where my plugins and themes call it from. You can place it anywhere you like, and there are probably old copies in my plugins too. Yes, you can do all of this the Tadlock Way (and the Tadlock Way is usually the right way), but I find WPAlchemy to be a small overhead price to pay for ease of use and function.

Dec 3, 2014 - WordPress    Comments Off on Move content directory for additional security

Move content directory for additional security

Add this to wp-config-sample.php after an update, or add it to wp-config.php. Just after the prefix code. Replace “newdir” with the name of your new directory.

/**
 * Move content directory for additional security
 */
define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/newdir' );
define( 'WP_CONTENT_URL', 'http://'.$_SERVER['SERVER_NAME'].'/newdir' );
Nov 25, 2014 - WordPress    Comments Off on Bootstrap for dynamic widget widths

Bootstrap for dynamic widget widths

jQuery(document).ready(function($) {	
    var numwidgets = $('.header-widget-area section.widget').length;
    $('.header-widget-area').addClass('cols-'+numwidgets);
    var cols = 12/numwidgets;
    $('.header-widget-area section.widget').addClass('col-sm-'+cols);
    $('.header-widget-area section.widget').addClass('col-xs-12');
});
Sep 2, 2014 - Domain Issues, Hosting Headaches, PlugIns, WordPress    Comments Off on Contact Form 7 and Bluehost

Contact Form 7 and Bluehost

Had some issues setting up a site developed by other developers. Aaaaaand this is why Gravity Forms is better. But, anyway, the solution was simple enough: http://wordpress.org/support/topic/contact-form-7-not-working-6

Update: Come to find the same issue with Gravity Forms on a Liquid Web VPS. I realized that (duh) this would always be an issue for clients who use a remote mail exchanger, as the server won’t even look outside itself if it thinks the mail exchanger is local. So, the steps for a cPanel host (which is most of my clients):

cPanel->Mail->MX Entry->Choose Domain-> Find MX Record and look for “Email Routing”->Change to Remote Exchanger.

Of course, ONLY do this for sites that aren’t using the web host to collect mail!

Pages:12345»