Skip to content

Instantly share code, notes, and snippets.

View sumanahmed's full-sized avatar

Suman Ahmed sumanahmed

  • Future Plan IT Solution
  • Dhaka
View GitHub Profile
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'testimonial',
array(
'labels' => array(
'name' => __( 'Testimonial' ),
'singular_name' => __( 'Testimonial' ),
'add_new' => __( 'Add New' ),
'add_new_item' => __( 'Add New Testimonial' ),
'edit_item' => __( 'Edit Testimonial' ),
add_action('init', 'theme_register_menu');
function theme_register_menu() {
if (function_exists('register_nav_menu')) {
register_nav_menu( 'theme-main-menu', __( 'Main Menu', 'brightpage' ) );
}
}
function theme_default_menu() {
echo '<ul id="dropmenu">';
if ('page' != get_option('show_on_front')) {
echo '<li><a href="'. site_url() . '/">Home</a></li>';
/*This code for sidebar widget register*/
function widget_areas() {
register_sidebar( array(
'name' => 'Left Menu',
'id' => 'left_sidebar',
'before_widget' => '<div class="single_sidebar">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>',
function category_post_shortcode($atts){
extract( shortcode_atts( array(
'title' => '',
'link' => '',
'category' => '',
), $atts, 'category_post' ) );
global $post;
$q = new WP_Query(
function dynamic_add_linking($atts, $content=null){
extract(shortcode_atts(array(
'link' => '',
'img' => '',
'title' => '',
), $atts, 'ads') );
return '<a href=""><img src="'.$img.'" alt="" /></a>';
}