Skip to main content

Posts

Straight-forward Pure CSS Social Icons

This is a chunk of code I use on a lot of sites.  It uses Font Awesome to supply the fonts, but everything else is handled via CSS. Font Awesome To start, you'll need a Font Awesome account / link to use to import your font files (which will be used to show the social network icons). They will provide you with a script link you can put into your header.php, load into your functions.php and/or download locally and link locally...really, it's up to you how you load the script. The HTML code is just a simple list: <ul class="social-media-icons"> <li><a class="facebookBtn smGlobalBtn" href="https://www.facebook.com/yoursitehere" target="_blank"></a></li> <li><a class="linkedinBtn smGlobalBtn" href="https://www.linkedin.com/in/yoursitehere" target="_blank"></a></li> <li><a class="twitterBtn smGlobalBtn" href="https://twit...

A Very Useful Script For Updating Your Wordpress Database After Migration

In PHPMyAdmin, you can run this to update the database to it's new destination: SET @oldsite='http://oldsite.com'; SET @newsite='http://newsite.com'; UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite); UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite); UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite); UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite); Don't forget to update the table names to match those in your database.

Failed to load resource: the server responded with a status of 412 - Fix

Recently, I ran into an issue with a Divi install I was running on a new server.  For whatever reason, it suddenly wasn't loading any of the scripts necessary. I tried rolling back the theme, but that didn't do anything.  I then tried re-installing Wordpress, but that didn't fix anything. A Google search led me to this article - https://wordpress.org/support/topic/failed-to-load-jquery-at-load-scripts-php/ Which led to this extremely quick fix: Try adding define('CONCATENATE_SCRIPTS', false); to your wp-config.php file just below the define('DB_HOST' line. After adding that to my wp-config file, everything worked as expected.

Disable on-screen keyboard that appears in Adobe products

So, I had an issue with Adobe inDesign on my Windows 10 PC. The onscreen keyboard kept popping up whenever I tried to edit text because the program couldn't tell that while I am on a touch screen enabled device, I do not have touch screens nor do I want an onscreen keyboard. To disable: Run: services.msc (windows key + R) Find the service called:  Touch Keyboard and Handwriting Panel Service (TabletInputService) Double click it to open up the Properties dialog You will want to not just stop the service, but disable it. Now, I still ran into a problem with the service restarting.  To fix this, click on the Recovery tab and change all the failure actions to Take No Action

Divi Theme - Remove pause 'on hover' of the full width slider

In the Divi theme, open up /js/custom.js Comment out the following code (around line 144) if ( settings.slideshow && et_slides_number > 1 ) { $et_slider.hover( function() { $et_slider.addClass( 'et_slider_hovered' ); if ( typeof et_slider_timer != 'undefined' ) { clearInterval( et_slider_timer ); } }, function() { $et_slider.removeClass( 'et_slider_hovered' ); et_slider_auto_rotate(); } ); }

Removing comments from the Wordpress Twenty Fourteen theme

To permanently remove comments from the Wordpress Twenty Fourteen theme, the file you will want to edit is: /themes/twentyfourteen/single.php Within this file, you will find the following code which you can either delete or comment out: // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) { comments_template(); } Now, there is also meta  info for each content type which will list the number of comments next to the date the post was posted on under the title of each post.  You'll like want to remove this reference as well (otherwise, they will all say 0 comments). To do so, open up the content- .php  file in the theme folder.  For example, on a site I did this on, I edited the content-image.php  file. Look for the div with the class " entry-meta " and delete the line referencing " comments " within that div.  Just cull those lines.

Wordpress Plugin - Lightbox Gallery: Separate Galleries on page

If you are using the Lightbox Gallery plugin for Wordpress and want to enable it on a "blog roll" type page (where all your posts show up on one page), you will find that the lightbox pop up will actually include all the images on the page when you only want it to include the images from that specific post. The solution is a quick code change in /wp-content/plugins/lightbox-gallery/lightbox-gallery.php Search for: 'class'      => "'" . $post->ID . "'",  and replace with: 'class'      => 'gallery1',

How To Set Default Attachment Display Settings In WordPress

This is a pretty quick fix. Add this to your functions.php for your theme and then you can set the default for the image attachment settings function mytheme_setup() { // Set default values for the upload media box update_option('image_default_align', 'center' ); update_option('image_default_link_type', 'media' ); update_option('image_default_size', 'large' ); } add_action('after_setup_theme', 'mytheme_setup'); Obviously changing the values to what you want as the default.

Wordpress - Creating Pages On Site Setup

If you, like me, create a bunch of Wordpress sites and, while building your menu, create all the blank pages for placeholders, then this plugin is for you. http://wordpress.org/plugins/bulk-page-creator/ The Bulk Page Creator lets you create all your pages on one single page using a little Ajax.  It's quite simple and saves you a ton of time.

Heart Shaped Social Icon for Instagram

A bit of a random post I grabbed this icon set for a site: Heart Shaped Icons . Unfortunately, it was missing the Instragam icon, so I made my own:

WP Anything Slider

I recently added the WP Anything Slider to a Wordpress blog that I was doing development on.  The default animation options are scrolls (based on the JQuery Cycle plugin).  I wanted to add a fade animation. Thankfully, it's pretty easy to add fade as an effect.  You can add whatever you want from the Jquery Cycle Plugin. Just edit plugins/cycle-setting.php and search for the options list, duplicate the line with "ScrollDown" on it and then replaced the instances of ScrollDown on that line with Fade...done. <select id="wpanything_sdirection" name="wpanything_sdirection"> <option value=""></option> <option echo="" if="" php="" scrollleft="" selected="" value="scrollLeft" wpanything_sdirection_x="=">&gt;scrollLeft</option> <option echo="" if="" php="" scrollright=...

Fix For Joomla Admin Menu That Stops Working

A quick fix for those of us who have encountered the top admin menu in Joomla becoming unresponsive. You know, you click, but no sub menu appears? If you check your dev tool of choice (ie. Firebug), you'll most likely see something like this: $ES is not defined The issue has to do with mootools.js and how older versions of Joomla handle the rendering of the admin menus.  Recently, I ran into this issue when I installed a newer version of mootools so that I could get a lightbox effect on a Joomla Virtuemart store.  What I didn't realize at the time was this resulted in the admin menu failing. The fix, thankfully, is quite easy. The file is:  /administrator/templates/khepri/js/menu.js The changes are: Find: var elements = $ES('li', el); Replace with:   var adminMenu=el.id; var elements = $(adminMenu).getElements('li'); Find: nested = $E('ul', element); Replace with: nested = element.getElement('ul');

YiiFramework - Check If User Is Logged In (couponic)

So, I was doing a bit of customization of a Couponic template where I wanted to add a squeeze box (a future post!), but I first needed to check if a user was logged in or not. I didn't want a logged in user to see the squeeze box so I needed to figure out how the framework checked if a user is logged in. Well, it's pretty simple (I've included a quick and dirty write to the browser console log for quick debugging) <?php $isUser = Yii::app()->user->checkAccess('user'); if(!$isUser){ ?> <script> console.log("NOT A USER!!!!!!!!!!!!"); </script> <?php }else{ ?> <script> console.log("IS A USER!!!!!!!!!!!!"); </script> <?php } ?>

Virtuemart: Different Free Shipping Amount For Different Countries

How to adapt Virtuemart's Minimum Amount For Free Shipping so it can handle different amounts for different countries: Now, before we begin, the usual warning:  Backup the files you are going to be working with.  This is a hack of the global.php file to allow different free shipping amounts for different countries. The file you'll be working with:  /administrator/components/com_virtuemart/global.php First, in the Virtuemart administration page, go to the Store -> Edit Store page and set the base amount you want to use for 'free shipping'.  Usually, this should be the value you set for the most commonly used free amount you want to use (ie. your home country). Now, open up global.php , and search for: $vendor_freeshipping = $db->f("vendor_freeshipping"); The example will show how to detect for a country and hard-code in a new value for free-shipping. Ie. The amount set in the VM Admin page will be the base amount for free shipping in Canada. ...

How To Run Chrome From Within Notepad++

If you have recently tried to Run  Chrome from within Notepad++ recently, you've probably encountered the same issue I did.  Chrome didn't run. The fix is actually really simple.  Open up the Run box in Notepad++ and browse to your installation of Chrome. ie.  C:\Program Files\Google\Chrome\Application\Chrome.exe Select the file when you find it.  Now, the trick is: Put quotation marks around the path you see in the Run  box.  Now, put 1 space after the closing quotation mark. Type this: $(FULL_CURRENT_PATH) It'll look something like this: Click Run .  If Chrome opens, click Save and set your hotkey.

How To Downgrade Your Wordpress Installation

I recently updated one of my Wordpress installations to 3.5 from 3.4.2 and found out that 3.5 really isn't ready for release as it appears to have a slew of problems . So, what to do?  Downgrade back to 3.4.2, obviously.  A quick Google search brought up this great article with some good steps to follow:  http://etuts.org/manually-downgrade-wordpress/ Here are the steps, with my notes: Log into the administrative backend of your Wordpress installation and deactivate all your plugins (important) Create a backup of your site including the database for safety's sake ( or at least download all the files including those in the root directory, especially wp-config.php) Delete the \wp-admin and \wp-includes folders of your site either with your FTP client or through the backend cPanel of your hosting company.  File Manager in cPanel is a lot quicker than through FTP. Find the Wordpress 3.4.2 (or whatever version you are going to downgrade to) files:   http...

Drupal Search Not Working - Fix

Editing or creating a Drupal site where the search form stopped working or never worked in the first place? Enable 'Search' module in   http://sitename.com/ ?q=admin/module See   ?q=admin/settings/search   to see how many items are left to index.  If you see that the site says 0% indexed, 177 items to go or something along those lines, run cron. Run 'cron.php' from your browser like  http://www. sitename .com/cron.php Check   ?q=admin/settings/search   again to see the status of search module. That's it. Something I never thought to do while making the site, so hopefully this post helps someone else out.

Category Sort Plugin For Wordpress

I was recently using a theme that had a secondary posts section and I wanted to organize the categories of posts independently of each other. Thankfully, I stumbled across this plugin for Wordpress that is just an all-around great plugin:   Category Order and Taxonomy Terms Order . After installation, it creates a quick little Ajax driven drag and drop category sorter under your posts menu.

.htaccess Redirect

Previously, I posted a quick .htaccess tip which you can find here:  http://2bluesolutions.blogspot.ca/2012/07/apache-modrewrite-all-files-temporarily.html As an addendum, I have recently discovered this great site: http://htaccessredirect.net/index.php This site will generate an .htaccess file for you based on a whole bunch of variables you can enter into the form. It's probably not as complex as some of you would need, but those of us making complex .htaccess files don't need this site, right? It's a great tool for creating fast and simple .htaccess file for handling a bunch of redirections. http://htaccessredirect.net/index.php