Skip to content

Instantly share code, notes, and snippets.

View zachattack's full-sized avatar
🎯
Focusing

Zach zachattack

🎯
Focusing
View GitHub Profile
@zachattack
zachattack / sx-accordion
Created August 30, 2012 15:18
html accordion formatting example
<div id="accordian">
<h3><a href="#">Clickable link to expand the content within</a></h3>
<div>
<p>Whatever content you would like.</p>
<ul>
<li>Lists of stuff are totally ok.</li>
<li>Even links to things that are silly like <a href="http://theoatmeal.com/">The Oatmeal</a>.</li>
</ul>
<p>Whatever content you would like.</p>
@zachattack
zachattack / box-model-fix
Created August 31, 2012 20:25
Paul Irish box fix
/* apply a natural box layout model to all elements */
/* http://paulirish.com/2012/box-sizing-border-box-ftw/ */
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
@zachattack
zachattack / gist:3728371
Created September 15, 2012 15:00
Drupal form tweaking
// Custom search form tweaking funciton.
function YOURTHEME_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'search_block_form') {
$form['search_form']['#title'] = t('Search'); // Change the text on the label element
$form['search_form']['#title_display'] = 'invisible'; // Toggle label visibilty
$form['search_form']['#size'] = 40; // define size of the textfield
$form['search_form']['#default_value'] = t('Search'); // Set a default value for the textfield
//$form['actions']['submit']['#value'] = t('GO!'); // Change the text on the submit button
//$form['actions']['submit'] = array('#type' => 'image_button', '#src' => base_path() . path_to_theme() . '/images/search-button.png');
@zachattack
zachattack / block-title-unset
Created July 18, 2013 21:15
Unset a block title in Drupal 7 with preprocess.
function YOURTHEME_preprocess_block(&$variables, $hook) {
// Unset the block titles in the region of choice.
if ($variables['block']->region == 'region-you-target') {
unset($variables['block']->subject);
}
}
@zachattack
zachattack / Drupal 7 facebook meta
Created February 19, 2014 18:51
Pesky Facebook sharing scraper fixes. This will allow you total control of the meta info for the Facebook scraper and will allow you to customize the image and title text that is displayed for any node.
// This goes into your template.php file
function YOURTHEME_preprocess_html(&$variables, $hook) {
// Add a title variable to the html template that uses the current node's title.
if ($node = menu_get_object()) {
$variables['html_title'] = $node->title;
}
// Use the theme's logo as the og:image.
$variables['html_logo'] = theme_get_setting('logo');
}
@zachattack
zachattack / audio-converter.sh
Last active May 3, 2016 16:55
Easy FFMPEG Audio Converter Script
for a in *.audio ; do
f="${a[@]/%audio/mp3}"
ffmpeg -i "$a" -acodec libmp3lame -q:a 0 "$f"
done
@zachattack
zachattack / pseudo-placeholder-who.css
Created October 14, 2016 19:48
The Pseudo Placeholder Text
/*
FROM CSS Tricks 2013
https://css-tricks.com/snippets/css/style-placeholder-text/
*/
::-webkit-input-placeholder {
color: red;
}
:-moz-placeholder { /* Firefox 18- */
@zachattack
zachattack / wp-gulp.js
Created November 13, 2018 16:18
Simple Gulp Config for Word Press Dev
// Gulp.js configuration
'use strict';
const
// source and build folders
dir = {
src : './static/',
lib : './static/lib/',
build : './assets/'
<title><YOUR TITLE HERE> | University of TEXAS at Austin</title>
<meta property="og:title" content="<YOUR TITLE HERE>" />
<meta name="author" content="<SITE or POST AUTHOR>" />
<meta property="og:locale" content="en" />
<meta name="description" content="<POST SUMMARY or DEFAULT SITE DESCRIPTION>" />
<meta property="og:description" content="<POST SUMMARY or DEFAULT SITE DESCRIPTION>" />
<link rel="canonical" href="<SITE URL>" />
<meta property="og:url" content="<SITE URL>" />
<meta property="og:site_name" content="<SITE NAME>" />
<meta property="og:image" content="<SITE URL>/path/to/iamges.jpg" />

Export Migration and Mapping

If you have custom content types that you want to migrate from a Drupal 7 installation to a WordPress installation, you will need to have a few things in place to make it happen.

  1. Modify the default XML output templates to look and smell like a WordPress export.

  2. Mapping Categories If you have unique categories and you want them to match up with taxonomy that you have created on your new site, you will need intercept the categories that are presently applied and overwrite them.

  3. Create the needed Drupal views