RSS

Send emails with multiple attachments using wordpress

// values are just samples…

$to = “$inq_email”;
$subject = “Form Inquiry”;
$headers = ‘From: John Martel ‘ . “\r\n”;
$target_path = array(WP_CONTENT_DIR . ‘/uploads/sample1.pdf’);
array_push($target_path, WP_CONTENT_DIR . ‘/uploads/sample2.zip’);

$message = “

Thank you {$inq_name} for your inquiry and we will contact you as soon as we reviewed your message.

“;

if(wp_mail($to, $subject, $message, $headers, $target_path)) { echo ‘email success’; } else { echo ‘did not send’; }

 
Leave a comment

Posted by on September 25, 2011 in Wordpress

 

Tags: , , , ,

Registering a custom menu on your wordpress theme

// Add this on function.php
add_theme_support( ‘menus’ );
register_nav_menus( array( ‘menu_name’ => __( ‘Menu Description’) ) );

//add this on your theme. example is header.php
wp_nav_menu( array( ‘theme_location’ => ‘menu_name’ ) );

 
Leave a comment

Posted by on September 12, 2011 in Wordpress

 

Tags: , , ,

cat_is_ancestor_of

Returns true if $childcategory is a sub category of $parentcategory

 
Leave a comment

Posted by on August 27, 2011 in Wordpress

 

Get current category id and slug

//Check if the page is a category one and display the current category id and slug..

if ( is_category()) {
$cat = get_query_var(‘cat’);
$currentcat = get_category ($cat);
echo ‘current category id is ‘. $yourcat . ‘
‘;
echo ‘current category slug is ‘. $yourcat->slug
}

 
Leave a comment

Posted by on August 27, 2011 in Wordpress

 

wp_list_categories() exclude by slug name wordpress

<?php

$category = get_category_by_slug(‘uncategorized’);
$catid = $category->term_id;

wp_list_categories(‘orderby=order&title_li=&hide_empty=0&exclude=116,’.$catid);

?>

 
Leave a comment

Posted by on July 7, 2011 in Wordpress

 

Tags: , , ,

Displaying Static Blocks in Magento

// replace the identifier name with the Identifier * field value of your static block
getLayout()->createBlock(‘cms/block’)->setBlockId(‘identifier’)->toHtml() ?>

 
Leave a comment

Posted by on May 29, 2011 in Magento

 

Tags:

Force one column layout for wordpress post area

This will make the wordpress post area default to one column and force current users to use one column layout

//Add this on function.php
function one_screen_column_layout( $columns_width ) {
$columns_width['post'] = 1;
return $columns_width;
}
add_filter( ‘screen_layout_columns’, ‘one_screen_column_layout’ );

function sone_screen_column_layout() {
return 1;
}
add_filter( ‘get_user_option_screen_layout_post’, ‘one_screen_column_layout’ );

 
Leave a comment

Posted by on May 14, 2011 in Wordpress

 

Tags:

 
Follow

Get every new post delivered to your Inbox.