Adobe: Can’t launch Dreamweaver CS5 | Mac OS Fix!

   Posted: December 17th, 2010    By: Devin Walker   

In my previous article on the site: Nothing happens when launching Dreamweaver CS5 on Mac I discussed my workaround to fix this problem. Basically, it was removing the Configuration folder from the hd/users/library/application support/adobe/dreamweaver cs5/en-US/ directory. This would allow you to start Dreamweaver again because it would create a new “configuration” folder. But the problem was, Dreamweaver would eventually act up again and by the time a couple weeks rolls around you’ll have dont this process 4-5 time. Thanksfully, Adobe has heard the communities’ cries and they have released an update for Mac Dreamweaver users.

Adobe Dreamweaver CS5 Launch Fix

Read the rest of this entry »

How to Use a Facebook Like Button on Any Page

   Posted: July 9th, 2010    By: Devin Walker   

The facebook like button is in. I know, you’ve been seeing it more and more around the web and now you want to implement it on your own website. I’ll show you how to do just this using a little snippet of code that will allow you to add a dynamic Facebook “like” button to any page on your website!

Implement a dynamic Facebook Like button

Read the rest of this entry »

WordPress Heirarchical Sidebar Page Menus

   Posted: June 14th, 2010    By: Devin Walker   
Let's say you want to show a hierarchical sidebar menu that displays a listing of current subpages. This is easy enough, but let's say that you have a top menu that shows all top-level pages. Once you click on a top level page from that menu it will take you there and in the sidebar show all subsequent child pages. Now what if those child pages have a child? You don't want all menu items to disappear when you click on one of those child pages. That just looks funny. Here's the bit of code that works great for me:
<?php 
if ((count($post->ancestors) > 0) 
        && ($data = array_reverse($post->ancestors)) 
        && !is_null($data[0])){ 
	$data = wp_list_pages('title_li=&echo=0&child_of='.$data[0]); 
} else { 
        $data = wp_list_pages('title_li=&echo=0&child_of='.$post->ID); 	
} 
if (strlen($data) != '') {?>
          <ul class='nav'><?php echo  $data; ?></ul>	
<?php } ?>

With 2 comments

Posted in PHP,Wordpress

Tagged with

Link separators for wp_list_pages() code snippet

   Posted: May 28th, 2010    By: Devin Walker   

WordPress makes it very easy to dynamically create menus from pages and categories with the use of the function wp_list_pages() and wp_list_cats()... but what if you want to have separators in your menus? Here's a bit of code that will do just that:

wp_list_pages Separators

$args = array(
  'sort_column' => 'menu_order',
  'title_li' => '',
  'depth' => '1',
  'echo' => 0
);
$separator = ' | ';
$pattern = '/(<\\/a>).*?(<\\/li>).*?(<li)/is';
$replace = '</a>' . $separator . '</li><li';
$subnav = preg_replace($pattern,$replace,wp_list_pages($args));
echo $subnav;

Please note: I got this code from Rares Comes (very nice lavalamp menu there)

With 2 comments

Posted in PHP,Wordpress

Tagged with ,

WordPress List Subpages Even if On Subpage

   Posted: May 25th, 2010    By: Devin Walker   

I'm building a new site and the navigation on it requires me to use a different bit of code for parent and child pages. I thought I'd share the code for those out there building a similar navigation. Here's a handy bit of code that you can use to display all subpages on a subpage. For instance, you have your pages setup like so:

Page: Fruit
subpage: Banana
subpage: Apply
subpage: Orange

On Parent Page

If you were wanting to show a navigation menu of all subpages in the Fruit category you could use the following bit of code:

<?php
  $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
  if ($children) { ?>
  <ul id="mainNav">
	<div id="locationsNavHead">choose a product</div>
  <?php echo $children; ?>
  </ul>
<?php } ?>

On Subpages

For child, or subpages, we could use the following bit of code:

<div id="sidebar">
<?php
//list subpages even if on a subpage
  if($post->post_parent)
  $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
  else
  $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
  if ($children) { ?>
  <ul id="mainNav">
  <div id="locationsNavHead">choose a product</div>
  <?php echo $children; ?>
  </ul>
<?php } ?>
</div>

If you are confused at what this all means please comment below and check out wp_list_pages() over at the WordPress Codex

With 3 comments

Posted in HTML,PHP,Wordpress

Tagged with