Skip to content

Instantly share code, notes, and snippets.

View zachbrowne's full-sized avatar

Zach Browne zachbrowne

View GitHub Profile
@zachbrowne
zachbrowne / Thesis Theme Snippets
Created October 8, 2011 23:16
Thesis Theme Snippets
# Add menu to footer
register_nav_menu('footer','Footer Menu');
function custom_footer_menu() {
wp_nav_menu(array(
'container' => '',
'menu_id' => 'footer_nav',
'fallback_cb' => 'thesis_nav_menu',
'theme_location' => 'footer',
));
}
@zachbrowne
zachbrowne / Thesis Framework Snippets
Created October 11, 2011 19:23
WordPress Thesis Framework custom_function.php file snippets.
# Move menu below header
remove_action('thesis_hook_before_header', 'thesis_nav_menu');
add_action('thesis_hook_after_header', 'thesis_nav_menu');
#
@zachbrowne
zachbrowne / WordPress Category Widget Drop Down Widen CSS Code
Created October 22, 2011 15:54
This code will widen the category widget drop-down in the WordPress sidebar (or any widget).
#cat { width: 100%; }
@zachbrowne
zachbrowne / WordPress SEO .htaccess
Created October 23, 2011 19:37
Very good .htaccess file for WordPress SEO
User-agent: *
Disallow: */trackback*
Disallow: /wp-*
Disallow: */feed*
Disallow: /20*
User-Agent: MediaPartners-Google
Allow: /
@zachbrowne
zachbrowne / APC Memcache on Ubuntu
Created October 23, 2011 21:10
Setting up APC and Memcache on Ubuntu
apt-get install php-apc
/etc/init.d/apache2 restart
php -r ‘phpinfo();’ | grep ‘apc’ # See if output shows apc is on
apt-get install php5-memcache
nano /etc/php5/apache2/php.ini
# Change session.save_handler = files to
session.save_handler = memcache
session.save_path = “tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15″
/etc/init.d/apache2 restart
@zachbrowne
zachbrowne / verifyemail.php
Created October 31, 2011 06:48
Verify email with PHP
<?php
function VerifyEmail($email){
return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email);
}
if(VerifyEmail('<a class="linkclass" href="mailto:info@samplephpcodes.com">info@samplephpcodes.com</a>')) {
echo 'valid email';
} else {
echo 'in valid email';
}
@zachbrowne
zachbrowne / GetMeta.php
Created October 31, 2011 06:38
Get Title and Meta Keywords from any site with PHP
<?php
function getUrlData($url)
{
$result = false;
$contents = getUrlContents($url);
if (isset($contents) && is_string($contents))
{
$title = null;
@zachbrowne
zachbrowne / generatefeed.php
Created October 31, 2011 06:49
Generate RSS feed with PHP
<?php
$XMLoutput = "<?xml version=\"1.0\"?>
<rss version=\"2.0\">
<channel>
<title>PHP RSS XML FEED</title>
<link><a class="linkclass" href="http://www.exampledomain.com/RSS-XML-FEED.php">http://www.exampledomain.com/RSS-XML-FEED.php</a></link>
<description>RSS Feed Description</description>
<language>en-us</language>
<pubDate>dd/mm/yy</pubDate>
<lastBuildDate>dd/mm/yy</lastBuildDate>
@zachbrowne
zachbrowne / consulting.html
Created November 7, 2011 22:17
My Consulting Page
Because of recent large-scale, industry-shifting trends in <strong>Search Engine Optimization</strong> that have all but redefined the classic model of SEO, I've redefined my role from a <strong>SEO Consultant</strong> to a <strong>Web Strategy Consultant</strong>. I now provide organizations with a <strong>Web Strategy Blueprint</strong> that includes an array of <em>metrics</em> and specific <em>tasks</em> that are customized to meet the <em>unique</em> goals of your organization.
<strong>Some of the factors that helped me make the shift to a Web Strategy Consultant include:</strong>
<ul>
<li>The <a href="http://www.seobook.com/google-branding">Vince algorithm update</a> by Google that gives better known brands higher rankings than smaller, lesser known sites.</li>
<li>The <a href="http://www.mattcutts.com/blog/algorithm-change-launched/">Panda algorithm update</a> by Google and its focus on a user's behavior as well as the trust and authority of websites based look/feel/content/style/etc.</li>
<li>The
@zachbrowne
zachbrowne / meta.html
Created November 7, 2011 22:27
My title tag and description for zachbrowne.com
Web Strategy Consulting - Marketing Strategy | Zach Browne
Zach Browne has been a professional Web Strategy Consultant for over a decade and is very knowledgeable about emerging web technologies, marketing trends, search engine optimization, social media marketing, online reputation management, web development and page speed optimization. He helps organizations develop organic web stratagies that encompass all aspects of online opportunities to increase traffic, convert more visitors and improve customer retention.