Jump to content

Please help - Parse error: syntax error, unexpected $end in /home2/jh2012/public_html/wp-content/themes/Backstreet/functions.php on line 795


slapshotstudio

Recommended Posts

<?php     

// Register Widgetized Areas

if(function_exists('register_sidebar')) {

    register_sidebar(array(

        'name' => 'Sidebar',

        'before_widget' => '<div class="widget">',

        'after_widget' => '</div>',

        'before_title' => '<h3 class="sidebar-widget-title"><span>',

        'after_title' => '</span></h3>',

    ));

    register_sidebar(array(

        'name' => 'Magazine',

        'before_widget' => '<div class="magazine-widget">',

        'after_widget' => '</div><div class="clear"></div>',

        'before_title' => '<div class="widget-line-title"><h3>',

        'after_title' => '</h3></div>',

    ));

    register_sidebar(array(

        'name' => 'Footer 1',

        'before_widget' => '<div class="widget-footer">',

        'after_widget' => '</div>',

        'before_title' => '<h3 class="widget-footer-title">',

        'after_title' => '</h3>',

    ));

    

    register_sidebar(array(

        'name' => 'Footer 2',

        'before_widget' => '<div class="widget-footer">',

        'after_widget' => '</div>',

        'before_title' => '<h3 class="widget-footer-title">',

        'after_title' => '</h3>',

    ));

    

    register_sidebar(array(

        'name' => 'Footer 3',

        'before_widget' => '<div class="widget-footer">',

        'after_widget' => '</div>',

        'before_title' => '<h3 class="widget-footer-title">',

        'after_title' => '</h3>',

    ));

    register_sidebar(array(

        'name' => 'Footer 4',

        'before_widget' => '<div class="widget-footer">',

        'after_widget' => '</div>',

        'before_title' => '<h3 class="widget-footer-title">',

        'after_title' => '</h3>',

    ));

}

// Add post format

add_theme_support('post-formats', array('gallery', 'audio', 'video'));



// Remove Gallery Styling

add_filter( 'gallery_style', 'my_gallery_style', 99 );

function my_gallery_style() {

    return "<div id='gallery'>";

}

/*



function SearchFilter($query) {

if ($query->is_search) {

$query->set('post_type',  array( 'post', 'reviews'));

}

return $query;

}

add_filter('pre_get_posts','SearchFilter'); */



// Add post thumbnail functionality

if ( function_exists( 'add_theme_support' ) ) {

    add_theme_support('post-thumbnails', array('post','reviews','gallery','portfolio'));

    add_image_size('carousel-thumb', 130, 90, true);

    add_image_size('big-post-thumb', 300, 150, true);

    add_image_size('small-post-thumb', 75, 60, true);

    add_image_size('related-thumb', 140, 90, true);

    add_image_size('big-nivo-thumb', 1000, 400, true);

    add_image_size('small-nivo-thumb', 620, 340, true);

    add_image_size('featured-thumb', 620, 270, true);

    add_image_size('featured-thumb', 940, 500, true);

    add_image_size('full-featured-thumb', 1000, 500, true);

    add_image_size('blog1-thumb', 300, 160, true);

    add_image_size('gallery-image', 140, 140, true);

    add_image_size('portfolio1-thumb', 300, 180, true);

    add_image_size('portfolio2-thumb', 220, 130, true);

}



// Widgets

include_once('panel/widgets/1-column-magazine-widget.php');

include_once('panel/widgets/2-column-magazine-widget.php');

include_once('panel/widgets/recent-posts-widget.php');

include_once('panel/widgets/tabs-sidebar-widget.php');

include_once('panel/widgets/facebook-like-widget.php');

include_once('panel/widgets/tweets-widget.php');

include_once('panel/widgets/flickr-widget.php');

include_once('panel/widgets/carousel-magazine-widget.php');

include_once('panel/widgets/social-widget.php');

include_once('panel/widgets/search-widget.php');

include_once('panel/widgets/adds300x250-widget.php');

include_once('panel/widgets/adds620x90-widget.php');

include_once('panel/widgets/latest-reviews.php');

include_once('panel/widgets/social-counter-widget.php');

include_once('panel/widgets/video-widget.php');



// UI Panel Options

include_once('panel/panel-options.php');



// Metaboxes

include_once('panel/metaboxes/metaboxes.php');



// Profile Metaboxes

include_once('panel/profile.php');



// Shortcodes

include_once('panel/shortcodes/shortcodes.php');





// Include reedwan framework file for the backstreet theme panel

include_once('panel/reedwan-framework.php');



// Translation

load_theme_textdomain('Backstreet', get_template_directory() . '/languages');



// Adds RSS feeds link

if(!get_option('reedwan_feedburner')) {

    add_theme_support('automatic-feed-links');

}



//////////////////////////////////////////////////////////////////

// Register reviews post type

//////////////////////////////////////////////////////////////////

add_action( 'init', 'register_reviews_post_type' );



function register_reviews_post_type() {

    register_post_type( 'reviews',

        array(

            'labels' => array(

                'name' => __( 'Reviews' ),

                'singular_name' =>  __( 'Review' ),

                'add_new' =>  __( 'Add New' ),

                'add_new_item' =>  __( 'Add New Review' ),

                'edit' =>  __( 'Edit' ),

                'edit_item' =>  __( 'Edit Review' ),

                'new_item' =>  __( 'New Review' ),

                'view' =>  __( 'View Review' ),

                'view_item' =>  __( 'View Review' ),

                'search_items' =>  __( 'Search Reviews' ),

                'not_found' =>  __( 'No reviews found' ),

                'not_found_in_trash' =>  __( 'No reviews found in Trash' ),

                'parent' =>  __( 'Parent Review' ),

            ),

            'public' => true,

            'show_ui' => true,

            'has_archive' => true,

            'publicly_queryable' => true,

            'show_in_nav_menus' => false,

            'exclude_from_search' => false,

            'hierarchical' => false,

            'rewrite' => array('slug'=>'review'),

            'supports' => array('title', 'editor', 'thumbnail', 'comments', 'author'),

        )

    );

flush_rewrite_rules();

}



//////////////////////////////////////////////////////////////////

// Register reviews category taxonomy

//////////////////////////////////////////////////////////////////

add_action( 'init', 'create_review_category', 0 );



function create_review_category()

{



  $labels = array(

    'name' => _x( 'Review Categories', 'taxonomy general name' ),

    'singular_name' => _x( 'Review Category', 'taxonomy singular name' ),

    'search_items' =>   __( 'Search Review Categories' ),

    'all_items' =>  __( 'All Review Categories' ),

    'parent_item' =>  __( 'Parent Review Category' ),

    'parent_item_colon' =>  __( 'Parent Review Category:' ),

    'edit_item' =>  __( 'Edit Review Category' ),

    'update_item' =>  __( 'Update Review Category' ),

    'add_new_item' =>  __( 'Add New Review Category' ),

    'new_item_name' =>  __( 'New Review Category Name' ),

    'menu_name' =>  __( 'Categories' ),

  );     



  register_taxonomy('review_category',array('reviews'), array(

    'public' => true,

    'show_in_nav_menus' => true,

    'hierarchical' => true,

    'labels' => $labels,

    'show_ui' => true,

    'query_var' => true,

  ));



}

//////////////////////////////////////////////////////////////////

// Register gallery post type

//////////////////////////////////////////////////////////////////

add_action( 'init', 'register_gallery_post_type' );



function register_gallery_post_type() {

    register_post_type( 'gallery',

        array(

            'labels' => array(

                'name' => __( 'Gallery' ),

                'singular_name' =>  __( 'Gallery' ),

                'add_new' =>  __( 'Add New' ),

                'add_new_item' =>  __( 'Add New Gallery' ),

                'edit' =>  __( 'Edit' ),

                'edit_item' =>  __( 'Edit Gallery' ),

                'new_item' =>  __( 'New Gallery' ),

                'view' =>  __( 'View Gallery' ),

                'view_item' =>  __( 'View Gallery' ),

                'search_items' =>  __( 'Search Gallery' ),

                'not_found' =>  __( 'No gallery found' ),

                'not_found_in_trash' =>  __( 'No gallery found in Trash' ),

                'parent' =>  __( 'Parent Gallery' ),

            ),

            'public' => true,

            'show_ui' => true,

            'has_archive' => true,

            'publicly_queryable' => true,

            'show_in_nav_menus' => false,

            'exclude_from_search' => false,

            'hierarchical' => false,

            'rewrite' => array('slug'=>'gallery'),

            'supports' => array('title', 'editor', 'thumbnail'),

        )

    );

flush_rewrite_rules();

}

//////////////////////////////////////////////////////////////////

// Register portfolio post type

//////////////////////////////////////////////////////////////////

add_action( 'init', 'register_portfolio_post_type' );



function register_portfolio_post_type() {

    register_post_type( 'portfolio',

        array(

            'labels' => array(

                'name' => __( 'Portfolio' ),

                'singular_name' =>  __( 'Portfolio' ),

                'add_new' =>  __( 'Add New' ),

                'add_new_item' =>  __( 'Add New Portfolio' ),

                'edit' =>  __( 'Edit' ),

                'edit_item' =>  __( 'Edit Portfolio' ),

                'new_item' =>  __( 'New Portfolio' ),

                'view' =>  __( 'View Portfolio' ),

                'view_item' =>  __( 'View Portfolio' ),

                'search_items' =>  __( 'Search Portfolio' ),

                'not_found' =>  __( 'No portfolio found' ),

                'not_found_in_trash' =>  __( 'No portfolio found in Trash' ),

                'parent' =>  __( 'Parent Portfolio' ),

            ),

            'public' => true,

            'show_ui' => true,

            'has_archive' => true,

            'publicly_queryable' => true,

            'show_in_nav_menus' => false,

            'exclude_from_search' => false,

            'hierarchical' => false,

            'rewrite' => array('slug'=>'portfolio'),

            'supports' => array('title', 'editor', 'thumbnail'),

        )

    );

flush_rewrite_rules();

}



//////////////////////////////////////////////////////////////////

// Register portfolio category taxonomy

//////////////////////////////////////////////////////////////////

add_action( 'init', 'create_portfolio_category', 0 );



function create_portfolio_category()

{



  $labels = array(

    'name' => _x( 'Portfolio Categories', 'taxonomy general name' ),

    'singular_name' => _x( 'Portfolio Category', 'taxonomy singular name' ),

    'search_items' =>   __( 'Search Portfolio Categories' ),

    'all_items' =>  __( 'All Portfolio Categories' ),

    'parent_item' =>  __( 'Parent Portfolio Category' ),

    'parent_item_colon' =>  __( 'Parent Portfolio Category:' ),

    'edit_item' =>  __( 'Edit Portfolio Category' ),

    'update_item' =>  __( 'Update Portfolio Category' ),

    'add_new_item' =>  __( 'Add New Portfolio Category' ),

    'new_item_name' =>  __( 'New Portfolio Category Name' ),

    'menu_name' =>  __( 'Portfolio Categories' ),

  );     



  register_taxonomy('portfolio_category',array('portfolio'), array(

    'public' => true,

    'show_in_nav_menus' => true,

    'hierarchical' => true,

    'labels' => $labels,

    'show_ui' => true,

    'query_var' => true,

  ));



}

// How comments are displayed

function reedwan_comment($comment, $args, $depth) {

    $GLOBALS['comment'] = $comment; ?>

    <li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">

    

        <div class="the-comment">

            <div class="alignleft">

                <?php echo get_avatar($comment,$size='70'); ?>

                <div class="clear"></div>

                <div class="reply-comment"><?php comment_reply_link(array_merge( $args, array('reply_text' => 'Reply', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?></div>

            </div>

            <div class="comment-box">

                <div class="comment-author">

                    <span class="name"><?php echo get_comment_author_link() ?></span>

                    <small><?php printf(__('%1$s at %2$s', 'Backstreet'), get_comment_date(),  get_comment_time()) ?><a><?php edit_comment_link(__(' Edit','Backstreet')) ?></a></small>

                </div>

            

                <div class="comment-text">

                    <?php if ($comment->comment_approved == '0') : ?>

                    <em><?php _e('Your comment is awaiting moderation.', 'Backstreet') ?></em>

                    <br />

                    <?php endif; ?>

                    <?php comment_text() ?>

                </div>

            

            </div>

            

        </div>







// Related Post

function get_related_posts($post_id, $tags = array()) {

    $query = new WP_Query();

    

    $post_types = get_post_types();

    unset($post_types['page'], $post_types['attachment'], $post_types['revision'], $post_types['nav_menu_item']);

    

    if($tags) {

        foreach($tags as $tag) {

            $tagsA[] = $tag->term_id;

        }

    }

    $query = new WP_Query( array('showposts' => 4,'post_type' => $post_types,'post__not_in' => array($post_id),'tag__in' => $tagsA,'ignore_sticky_posts' => 1,

    ));

      return $query;

}



// Kresi Pagination

function kriesi_pagination($pages = '', $range = 2)

{  

     $showitems = ($range * 2)+1;  



     global $paged;

     if(empty($paged)) $paged = 1;



     if($pages == '')

     {

         global $wp_query;

         $pages = $wp_query->max_num_pages;

         if(!$pages)

         {

             $pages = 1;

         }

     }   



     if(1 != $pages)

     {

         echo "<div class='pagination'>";

         if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'><span class='arrows'>«</span> First</a>";

         if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'><span class='arrows'>‹</span> Previous</a>";



         for ($i=1; $i <= $pages; $i++)

         {

             if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))

             {

                 echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>";

             }

         }



         if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>Next <span class='arrows'>›</span></a>";  

         if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last <span class='arrows'>»</span></a>";

         echo "</div>\n";

     }

}



// Limit Word

function string_limit_words($string, $word_limit)

{

    $words = explode(' ', $string, ($word_limit + 1));

    

    if(count($words) > $word_limit) {

        array_pop($words);

    }

    

    return implode(' ', $words);

}



<?php     

// Register Widgetized Areas

if(function_exists('register_sidebar')) {

    register_sidebar(array(

        'name' => 'Sidebar',

        'before_widget' => '<div class="widget">',

        'after_widget' => '</div>',

        'before_title' => '<h3 class="sidebar-widget-title"><span>',

        'after_title' => '</span></h3>',

    ));

    register_sidebar(array(

        'name' => 'Magazine',

        'before_widget' => '<div class="magazine-widget">',

        'after_widget' => '</div><div class="clear"></div>',

        'before_title' => '<div class="widget-line-title"><h3>',

        'after_title' => '</h3></div>',

    ));

    register_sidebar(array(

        'name' => 'Footer 1',

        'before_widget' => '<div class="widget-footer">',

        'after_widget' => '</div>',

        'before_title' => '<h3 class="widget-footer-title">',

        'after_title' => '</h3>',

    ));

    

    register_sidebar(array(

        'name' => 'Footer 2',

        'before_widget' => '<div class="widget-footer">',

        'after_widget' => '</div>',

        'before_title' => '<h3 class="widget-footer-title">',

        'after_title' => '</h3>',

    ));

    

    register_sidebar(array(

        'name' => 'Footer 3',

        'before_widget' => '<div class="widget-footer">',

        'after_widget' => '</div>',

        'before_title' => '<h3 class="widget-footer-title">',

        'after_title' => '</h3>',

    ));

    register_sidebar(array(

        'name' => 'Footer 4',

        'before_widget' => '<div class="widget-footer">',

        'after_widget' => '</div>',

        'before_title' => '<h3 class="widget-footer-title">',

        'after_title' => '</h3>',

    ));

}

// Add post format

add_theme_support('post-formats', array('gallery', 'audio', 'video'));



// Remove Gallery Styling

add_filter( 'gallery_style', 'my_gallery_style', 99 );

function my_gallery_style() {

    return "<div id='gallery'>";

}

/*



function SearchFilter($query) {

if ($query->is_search) {

$query->set('post_type',  array( 'post', 'reviews'));

}

return $query;

}

add_filter('pre_get_posts','SearchFilter'); */



// Add post thumbnail functionality

if ( function_exists( 'add_theme_support' ) ) {

    add_theme_support('post-thumbnails', array('post','reviews','gallery','portfolio'));

    add_image_size('carousel-thumb', 130, 90, true);

    add_image_size('big-post-thumb', 300, 150, true);

    add_image_size('small-post-thumb', 75, 60, true);

    add_image_size('related-thumb', 140, 90, true);

    add_image_size('big-nivo-thumb', 1000, 400, true);

    add_image_size('small-nivo-thumb', 620, 340, true);

    add_image_size('featured-thumb', 620, 270, true);

    add_image_size('featured-thumb', 940, 500, true);

    add_image_size('full-featured-thumb', 1000, 500, true);

    add_image_size('blog1-thumb', 300, 160, true);

    add_image_size('gallery-image', 140, 140, true);

    add_image_size('portfolio1-thumb', 300, 180, true);

    add_image_size('portfolio2-thumb', 220, 130, true);

}



// Widgets

include_once('panel/widgets/1-column-magazine-widget.php');

include_once('panel/widgets/2-column-magazine-widget.php');

include_once('panel/widgets/recent-posts-widget.php');

include_once('panel/widgets/tabs-sidebar-widget.php');

include_once('panel/widgets/facebook-like-widget.php');

include_once('panel/widgets/tweets-widget.php');

include_once('panel/widgets/flickr-widget.php');

include_once('panel/widgets/carousel-magazine-widget.php');

include_once('panel/widgets/social-widget.php');

include_once('panel/widgets/search-widget.php');

include_once('panel/widgets/adds300x250-widget.php');

include_once('panel/widgets/adds620x90-widget.php');

include_once('panel/widgets/latest-reviews.php');

include_once('panel/widgets/social-counter-widget.php');

include_once('panel/widgets/video-widget.php');



// UI Panel Options

include_once('panel/panel-options.php');



// Metaboxes

include_once('panel/metaboxes/metaboxes.php');



// Profile Metaboxes

include_once('panel/profile.php');



// Shortcodes

include_once('panel/shortcodes/shortcodes.php');





// Include reedwan framework file for the backstreet theme panel

include_once('panel/reedwan-framework.php');



// Translation

load_theme_textdomain('Backstreet', get_template_directory() . '/languages');



// Adds RSS feeds link

if(!get_option('reedwan_feedburner')) {

    add_theme_support('automatic-feed-links');

}



//////////////////////////////////////////////////////////////////

// Register reviews post type

//////////////////////////////////////////////////////////////////

add_action( 'init', 'register_reviews_post_type' );



function register_reviews_post_type() {

    register_post_type( 'reviews',

        array(

            'labels' => array(

                'name' => __( 'Reviews' ),

                'singular_name' =>  __( 'Review' ),

                'add_new' =>  __( 'Add New' ),

                'add_new_item' =>  __( 'Add New Review' ),

                'edit' =>  __( 'Edit' ),

                'edit_item' =>  __( 'Edit Review' ),

                'new_item' =>  __( 'New Review' ),

                'view' =>  __( 'View Review' ),

                'view_item' =>  __( 'View Review' ),

                'search_items' =>  __( 'Search Reviews' ),

                'not_found' =>  __( 'No reviews found' ),

                'not_found_in_trash' =>  __( 'No reviews found in Trash' ),

                'parent' =>  __( 'Parent Review' ),

            ),

            'public' => true,

            'show_ui' => true,

            'has_archive' => true,

            'publicly_queryable' => true,

            'show_in_nav_menus' => false,

            'exclude_from_search' => false,

            'hierarchical' => false,

            'rewrite' => array('slug'=>'review'),

            'supports' => array('title', 'editor', 'thumbnail', 'comments', 'author'),

        )

    );

flush_rewrite_rules();

}



//////////////////////////////////////////////////////////////////

// Register reviews category taxonomy

//////////////////////////////////////////////////////////////////

add_action( 'init', 'create_review_category', 0 );



function create_review_category()

{



  $labels = array(

    'name' => _x( 'Review Categories', 'taxonomy general name' ),

    'singular_name' => _x( 'Review Category', 'taxonomy singular name' ),

    'search_items' =>   __( 'Search Review Categories' ),

    'all_items' =>  __( 'All Review Categories' ),

    'parent_item' =>  __( 'Parent Review Category' ),

    'parent_item_colon' =>  __( 'Parent Review Category:' ),

    'edit_item' =>  __( 'Edit Review Category' ),

    'update_item' =>  __( 'Update Review Category' ),

    'add_new_item' =>  __( 'Add New Review Category' ),

    'new_item_name' =>  __( 'New Review Category Name' ),

    'menu_name' =>  __( 'Categories' ),

  );     



  register_taxonomy('review_category',array('reviews'), array(

    'public' => true,

    'show_in_nav_menus' => true,

    'hierarchical' => true,

    'labels' => $labels,

    'show_ui' => true,

    'query_var' => true,

  ));



}

//////////////////////////////////////////////////////////////////

// Register gallery post type

//////////////////////////////////////////////////////////////////

add_action( 'init', 'register_gallery_post_type' );



function register_gallery_post_type() {

    register_post_type( 'gallery',

        array(

            'labels' => array(

                'name' => __( 'Gallery' ),

                'singular_name' =>  __( 'Gallery' ),

                'add_new' =>  __( 'Add New' ),

                'add_new_item' =>  __( 'Add New Gallery' ),

                'edit' =>  __( 'Edit' ),

                'edit_item' =>  __( 'Edit Gallery' ),

                'new_item' =>  __( 'New Gallery' ),

                'view' =>  __( 'View Gallery' ),

                'view_item' =>  __( 'View Gallery' ),

                'search_items' =>  __( 'Search Gallery' ),

                'not_found' =>  __( 'No gallery found' ),

                'not_found_in_trash' =>  __( 'No gallery found in Trash' ),

                'parent' =>  __( 'Parent Gallery' ),

            ),

            'public' => true,

            'show_ui' => true,

            'has_archive' => true,

            'publicly_queryable' => true,

            'show_in_nav_menus' => false,

            'exclude_from_search' => false,

            'hierarchical' => false,

            'rewrite' => array('slug'=>'gallery'),

            'supports' => array('title', 'editor', 'thumbnail'),

        )

    );

flush_rewrite_rules();

}

//////////////////////////////////////////////////////////////////

// Register portfolio post type

//////////////////////////////////////////////////////////////////

add_action( 'init', 'register_portfolio_post_type' );



function register_portfolio_post_type() {

    register_post_type( 'portfolio',

        array(

            'labels' => array(

                'name' => __( 'Portfolio' ),

                'singular_name' =>  __( 'Portfolio' ),

                'add_new' =>  __( 'Add New' ),

                'add_new_item' =>  __( 'Add New Portfolio' ),

                'edit' =>  __( 'Edit' ),

                'edit_item' =>  __( 'Edit Portfolio' ),

                'new_item' =>  __( 'New Portfolio' ),

                'view' =>  __( 'View Portfolio' ),

                'view_item' =>  __( 'View Portfolio' ),

                'search_items' =>  __( 'Search Portfolio' ),

                'not_found' =>  __( 'No portfolio found' ),

                'not_found_in_trash' =>  __( 'No portfolio found in Trash' ),

                'parent' =>  __( 'Parent Portfolio' ),

            ),

            'public' => true,

            'show_ui' => true,

            'has_archive' => true,

            'publicly_queryable' => true,

            'show_in_nav_menus' => false,

            'exclude_from_search' => false,

            'hierarchical' => false,

            'rewrite' => array('slug'=>'portfolio'),

            'supports' => array('title', 'editor', 'thumbnail'),

        )

    );

flush_rewrite_rules();

}



//////////////////////////////////////////////////////////////////

// Register portfolio category taxonomy

//////////////////////////////////////////////////////////////////

add_action( 'init', 'create_portfolio_category', 0 );



function create_portfolio_category()

{



  $labels = array(

    'name' => _x( 'Portfolio Categories', 'taxonomy general name' ),

    'singular_name' => _x( 'Portfolio Category', 'taxonomy singular name' ),

    'search_items' =>   __( 'Search Portfolio Categories' ),

    'all_items' =>  __( 'All Portfolio Categories' ),

    'parent_item' =>  __( 'Parent Portfolio Category' ),

    'parent_item_colon' =>  __( 'Parent Portfolio Category:' ),

    'edit_item' =>  __( 'Edit Portfolio Category' ),

    'update_item' =>  __( 'Update Portfolio Category' ),

    'add_new_item' =>  __( 'Add New Portfolio Category' ),

    'new_item_name' =>  __( 'New Portfolio Category Name' ),

    'menu_name' =>  __( 'Portfolio Categories' ),

  );     



  register_taxonomy('portfolio_category',array('portfolio'), array(

    'public' => true,

    'show_in_nav_menus' => true,

    'hierarchical' => true,

    'labels' => $labels,

    'show_ui' => true,

    'query_var' => true,

  ));



}

// How comments are displayed

function reedwan_comment($comment, $args, $depth) {

    $GLOBALS['comment'] = $comment; ?>

    <li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">

    

        <div class="the-comment">

            <div class="alignleft">

                <?php echo get_avatar($comment,$size='70'); ?>

                <div class="clear"></div>

                <div class="reply-comment"><?php comment_reply_link(array_merge( $args, array('reply_text' => 'Reply', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?></div>

            </div>

            <div class="comment-box">

                <div class="comment-author">

                    <span class="name"><?php echo get_comment_author_link() ?></span>

                    <small><?php printf(__('%1$s at %2$s', 'Backstreet'), get_comment_date(),  get_comment_time()) ?><a><?php edit_comment_link(__(' Edit','Backstreet')) ?></a></small>

                </div>

            

                <div class="comment-text">

                    <?php if ($comment->comment_approved == '0') : ?>

                    <em><?php _e('Your comment is awaiting moderation.', 'Backstreet') ?></em>

                    <br />

                    <?php endif; ?>

                    <?php comment_text() ?>

                </div>

            

            </div>

            

        </div>







// Related Post

function get_related_posts($post_id, $tags = array()) {

    $query = new WP_Query();

    

    $post_types = get_post_types();

    unset($post_types['page'], $post_types['attachment'], $post_types['revision'], $post_types['nav_menu_item']);

    

    if($tags) {

        foreach($tags as $tag) {

            $tagsA[] = $tag->term_id;

        }

    }

    $query = new WP_Query( array('showposts' => 4,'post_type' => $post_types,'post__not_in' => array($post_id),'tag__in' => $tagsA,'ignore_sticky_posts' => 1,

    ));

      return $query;

}



// Kresi Pagination

function kriesi_pagination($pages = '', $range = 2)

{  

     $showitems = ($range * 2)+1;  



     global $paged;

     if(empty($paged)) $paged = 1;



     if($pages == '')

     {

         global $wp_query;

         $pages = $wp_query->max_num_pages;

         if(!$pages)

         {

             $pages = 1;

         }

     }   



     if(1 != $pages)

     {

         echo "<div class='pagination'>";

         if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'><span class='arrows'>«</span> First</a>";

         if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'><span class='arrows'>‹</span> Previous</a>";



         for ($i=1; $i <= $pages; $i++)

         {

             if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))

             {

                 echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>";

             }

         }



         if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>Next <span class='arrows'>›</span></a>";  

         if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last <span class='arrows'>»</span></a>";

         echo "</div>\n";

     }

}



// Limit Word

function string_limit_words($string, $word_limit)

{

    $words = explode(' ', $string, ($word_limit + 1));

    

    if(count($words) > $word_limit) {

        array_pop($words);

    }

    

    return implode(' ', $words);

}



// add_filter('widget_text', 'do_shortcode');

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.