a blog about handmade code

Vasna Sdoeung's blog

Top Navigation / Global Navigation

With the OOTB (out of the box) sharepoint menu, it doesn't include the "heading links". You'll have to switch use another datasource, more specifically, the publishing navigation.

Go ahead and add a new publishing navigation control. The attribute to pay attention to is the trimnoncurrenttypes, which is set to none. It will display all links navigation within the site.

 

Customizing Submitted By Theme

Customize the submitted by block by adding this code to the template.php. Remember to change the bolded theme_name_preprocess_node with the name of the theme.

Optimizing CSS and Javascript by Compression

When optimizing css and javascript it can be done with a few clicks. The best way to optimize it, is by compressing and caching both.

Locate them at admin > configuration > development > performance. There you'll see two options:

  1. Aggregate and compress css files.
  2. Aggregate Javascript files

Check both items and viola, your site is optimized. Keep in mind that these settings should be on for the live site.

មួយម៉ឹនអាល័យ ស៊ីន ស៊ីសាមុត​ Mouy Mern Alai

This song is just classic. I've accidentally run across it and was in trance with the wonderful song of sadness and love. Its a song about guy who loses his girlfriend. He wishes her the best as she marries, but she has second thoughts. His voice just brings back alot of the nostagic area of 70s and 80s.

Getting categories for a post

For more control over the post's category, use wp_get_post_categories function. It is a simple solution than doing a custom query. It requies passing a post id and arguments. To understand the arguments read about it from wp_get_object_terms. For information see wp_get_object_terms at http://codex.wordpress.org/Function_Reference/wp_get_object_terms

Finding the user id on Phpfox 2.0+

Simple enough, i had to go through code to find it. I totally forgot about the api at http://www.phpfox.com/phpapi/Phpfox/Phpfox.html.

phpfox accessing user group settings and variables

Accessing the User Group Settings (variables)

Lets say you want access to the user group setting for the blogs and find if they can add a new blog. In your controller class add:

Grabbing Custom Fields and Values

Getting the custom field can be fast. Here's an example.

Getting a Post Count in Wordpress

Finding the total post can be grueling. The easiest way is to find the post count from the query. Here's the code:

$total_post = $wp_query->post_count;

Read more about the wp_query at http://codex.wordpress.org/Class_Reference/WP_Query.

Subscribe to RSS - Vasna Sdoeung's blog
©2012 Tranzic Media / Portfolio of Vasna Sdoeung