Advertisement
Guest User

bloggless

a guest
Jan 2nd, 2014
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.20 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5. if ( ! isset( $content_width ) )
  6.  
  7. $content_width = 713;
  8.  
  9.  
  10.  
  11.  
  12.  
  13. /*-----------------------------------------------------------------------------------
  14.  
  15. - Start Themnific Functions - Please refrain from editing this section
  16.  
  17. ----------------------------------------------------------------------------------- */
  18.  
  19.  
  20.  
  21. // Set path to Themnific Framework and theme specific functions
  22.  
  23. $functions_path = get_template_directory() . '/functions/';
  24.  
  25. $includes_path = get_template_directory() . '/functions/';
  26.  
  27.  
  28.  
  29. // Framework
  30.  
  31. require_once ($functions_path . 'admin-init.php'); // Framework Init
  32.  
  33.  
  34.  
  35. // Theme specific functionality
  36.  
  37. require_once ($includes_path . 'theme-options.php'); // Options panel settings and custom settings
  38.  
  39. require_once ($includes_path . 'theme-actions.php'); // Theme actions & user defined hooks
  40.  
  41. require_once ($includes_path . 'theme-scripts.php'); // Load JavaScript via wp_enqueue_script
  42.  
  43.  
  44.  
  45.  
  46.  
  47. //Add Custom Post Types
  48.  
  49. require_once ($includes_path . 'posttypes/post-metabox.php'); // custom meta box
  50.  
  51.  
  52.  
  53. /*-----------------------------------------------------------------------------------
  54.  
  55. - Loads all the .php files found in /admin/widgets/ directory
  56.  
  57. ----------------------------------------------------------------------------------- */
  58.  
  59.  
  60.  
  61. $preview_template = _preview_theme_template_filter();
  62.  
  63.  
  64.  
  65. if(!empty($preview_template)){
  66.  
  67. $widgets_dir = WP_CONTENT_DIR . "/themes/".$preview_template."/functions/widgets/";
  68.  
  69. } else {
  70.  
  71. $widgets_dir = WP_CONTENT_DIR . "/themes/".get_option('template')."/functions/widgets/";
  72.  
  73. }
  74.  
  75.  
  76.  
  77. if (@is_dir($widgets_dir)) {
  78.  
  79. $widgets_dh = opendir($widgets_dir);
  80.  
  81. while (($widgets_file = readdir($widgets_dh)) !== false) {
  82.  
  83.  
  84.  
  85. if(strpos($widgets_file,'.php') && $widgets_file != "widget-blank.php") {
  86.  
  87. include_once($widgets_dir . $widgets_file);
  88.  
  89.  
  90.  
  91. }
  92.  
  93. }
  94.  
  95. closedir($widgets_dh);
  96.  
  97. }
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105. // Post thumbnail support
  106.  
  107. if (function_exists('add_theme_support')) {
  108.  
  109. add_theme_support('post-thumbnails');
  110.  
  111. set_post_thumbnail_size(640, 265, true); // Normal post thumbnails
  112.  
  113. add_image_size('block_1', 340, 205, true ); //(cropped)
  114.  
  115. add_image_size('block_2', 455, 405, true ); //(cropped)
  116.  
  117. add_image_size('block_3', 230, 205, true ); //(cropped)
  118.  
  119. add_image_size('block_4', 455, 205, true ); //(cropped)
  120.  
  121. add_image_size('block_5', 340, 405, true ); //(cropped)
  122.  
  123. add_image_size('carousel', 255, 190, true); //(cropped)
  124.  
  125. add_image_size('format-image', 470, 9999);
  126.  
  127. add_image_size('mansory', 325, 9999);
  128.  
  129. add_image_size('format-standard', 470, 330, true); //(cropped)
  130.  
  131. add_image_size('format-standard-alt', 657, 360, true); //(cropped)
  132.  
  133. add_image_size('blog', 190, 170, true); //(cropped)
  134.  
  135. add_image_size('w-slider', 470, 490, true); //(cropped)
  136.  
  137. add_image_size('w-featured', 150, 95, true); //(cropped)
  138.  
  139. add_image_size('w-big_single', 470, 240, true); //(cropped)
  140.  
  141. add_image_size('w-small_single', 100, 60, true); //(cropped)
  142.  
  143. add_image_size('tabs', 80, 60, true); //(cropped)
  144.  
  145. add_image_size('tabs2', 400, 205, true); //(cropped)
  146.  
  147. }
  148.  
  149.  
  150.  
  151. function thumb_url(){
  152.  
  153. $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 2100,2100 ));
  154.  
  155. return $src[0];
  156.  
  157. }
  158.  
  159.  
  160.  
  161.  
  162.  
  163. // Add Theme Support Functions
  164.  
  165. add_editor_style();
  166.  
  167. add_theme_support( 'post-formats', array( 'video','audio', 'gallery', 'image', 'quote', 'link' ) );
  168.  
  169. add_theme_support( 'automatic-feed-links' );
  170.  
  171. add_theme_support( 'custom-background' );
  172.  
  173.  
  174.  
  175. // widgets
  176.  
  177. if ( function_exists('register_sidebar') )
  178.  
  179. {
  180.  
  181.  
  182.  
  183. // homepage + sidebar widget
  184.  
  185. register_sidebar(array('name' => 'Homepage Content','before_widget' => '','after_widget' => '','before_title' => '<div class="widget wstyleh2"><span>','after_title' => '</span></div>'));
  186.  
  187. register_sidebar(array('name' => 'Middle Sidebar','before_widget' => '','after_widget' => '','before_title' => '<div class="widget wstyleh2"><span>','after_title' => '</span></div>'));
  188.  
  189. register_sidebar(array('name' => 'Homepage Sidebar','before_widget' => '','after_widget' => '','before_title' => '<div class="widget wstyleh2"><span>','after_title' => '</span></div>'));
  190.  
  191. register_sidebar(array('name' => 'Post Left Sidebar','before_widget' => '','after_widget' => '','before_title' => '<div class="widget wstyleh2"><span>','after_title' => '</span></div>'));
  192.  
  193. register_sidebar(array('name' => 'Post Right Sidebar','before_widget' => '','after_widget' => '','before_title' => '<div class="widget wstyleh2"><span>','after_title' => '</span></div>'));
  194.  
  195.  
  196.  
  197. //footer widgets
  198.  
  199. register_sidebar(array('name' => 'Footer 1','before_widget' => '','after_widget' => '','before_title' => '<div class="styleh2">','after_title' => '</div>'));
  200.  
  201. register_sidebar(array('name' => 'Footer 2','before_widget' => '','after_widget' => '','before_title' => '<div class="styleh2">','after_title' => '</div>'));
  202.  
  203. register_sidebar(array('name' => 'Footer 3','before_widget' => '','after_widget' => '','before_title' => '<div class="styleh2">','after_title' => '</div>'));
  204.  
  205. register_sidebar(array('name' => 'Footer 4','before_widget' => '','after_widget' => '','before_title' => '<div class="styleh2">','after_title' => '</div>'));
  206.  
  207. }
  208.  
  209.  
  210.  
  211. // Make theme available for translation
  212.  
  213. load_theme_textdomain( 'themnific', get_template_directory() . '/lang' );
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221. // Shordcodes
  222.  
  223. require_once (get_template_directory().'/functions/admin-shortcodes.php' ); // Shortcodes
  224.  
  225. require_once (get_template_directory().'/functions/admin-shortcode-generator.php' ); // Shortcode generator
  226.  
  227.  
  228.  
  229. // Use shortcodes in text widgets.
  230.  
  231. add_filter('widget_text', 'do_shortcode');
  232.  
  233.  
  234.  
  235. // navigation menu
  236.  
  237. function register_main_menus() {
  238.  
  239. register_nav_menus(
  240.  
  241. array(
  242.  
  243. 'main-menu' => "Main Menu",
  244.  
  245. 'secondary-menu' => "Secondary Menu" ,
  246.  
  247. )
  248.  
  249. );
  250.  
  251. };
  252.  
  253. if (function_exists('register_nav_menus')) add_action( 'init', 'register_main_menus' );
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261. // Shorten post title
  262.  
  263. function short_title($after = '', $length) {
  264.  
  265. $mytitle = explode(' ', get_the_title(), $length);
  266.  
  267. if (count($mytitle)>=$length) {
  268.  
  269. array_pop($mytitle);
  270.  
  271. $mytitle = implode(" ",$mytitle). $after;
  272.  
  273. } else {
  274.  
  275. $mytitle = implode(" ",$mytitle);
  276.  
  277. }
  278.  
  279. return $mytitle;
  280.  
  281. }
  282.  
  283.  
  284.  
  285.  
  286.  
  287. // icons - font awesome
  288.  
  289. function tmnf_icon() {
  290.  
  291.  
  292.  
  293. if(has_post_format('video')) {return '<i class="icon-play-circle"></i>';
  294.  
  295. }elseif(has_post_format('audio')) {return '<i class="icon-music"></i>';
  296.  
  297. }elseif(has_post_format('gallery')) {return '<i class="icon-picture"></i>';
  298.  
  299. }elseif(has_post_format('link')) {return '<i class="icon-signout"></i>';
  300.  
  301. }elseif(has_post_format('image')) {return '<i class="icon-camera"></i>';
  302.  
  303. }elseif(has_post_format('quote')) {return '<i class="icon-quote-right"></i>';
  304.  
  305. } else {'';}
  306.  
  307.  
  308.  
  309. }
  310.  
  311.  
  312.  
  313.  
  314.  
  315. // icons ribbons - font awesome
  316.  
  317. function tmnf_ribbon() {
  318.  
  319. if(has_post_format('video')) {return '<span class="ribbon"></span><span class="ribbon_icon"><i class="icon-play-circle"></i></span>';
  320.  
  321. }elseif(has_post_format('audio')) {return '<span class="ribbon"></span><span class="ribbon_icon"><i class="icon-music"></i></span>';
  322.  
  323. }elseif(has_post_format('gallery')) {return '<span class="ribbon"></span><span class="ribbon_icon"><i class="icon-picture"></i></span>';
  324.  
  325. }elseif(has_post_format('link')) {return '<span class="ribbon"></span><span class="ribbon_icon"><i class="icon-signout"></i></span>';
  326.  
  327. }elseif(has_post_format('image')) {return '<span class="ribbon"></span><span class="ribbon_icon"><i class="icon-camera"></i></span>';
  328.  
  329. }elseif(has_post_format('quote')) {return '<span class="ribbon"></span><span class="ribbon_icon"><i class="icon-quote-right"></i></span>';
  330.  
  331. } else {'';}
  332.  
  333.  
  334.  
  335. }
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343. // ratings
  344.  
  345.  
  346.  
  347. function tmnf_rating() {
  348.  
  349. $rinter = get_post_meta(get_the_ID(), 'tmnf_rating_main', true);
  350.  
  351. if ($rinter > 0) {
  352.  
  353. return $rinter .'<span>&#37;</span>';}
  354.  
  355. }
  356.  
  357.  
  358.  
  359. function tmnf_ratings() {
  360.  
  361. $rinter = get_post_meta(get_the_ID(), 'tmnf_rating_main', true);
  362.  
  363. if ($rinter >= 94 && $rinter <= 100) {return ' <span class="rating_star">
  364.  
  365. <i class="icon-star"></i>
  366.  
  367. <i class="icon-star"></i>
  368.  
  369. <i class="icon-star"></i>
  370.  
  371. <i class="icon-star"></i>
  372.  
  373. <i class="icon-star"></i>
  374.  
  375. </span>';}
  376.  
  377.  
  378.  
  379. if ($rinter >= 85 && $rinter < 94) {return ' <span class="rating_star">
  380.  
  381. <i class="icon-star"></i>
  382.  
  383. <i class="icon-star"></i>
  384.  
  385. <i class="icon-star"></i>
  386.  
  387. <i class="icon-star"></i>
  388.  
  389. <i class="icon-star-half"></i>
  390.  
  391. </span>';}
  392.  
  393.  
  394.  
  395. if ($rinter >= 75 && $rinter < 84) {return ' <span class="rating_star">
  396.  
  397. <i class="icon-star"></i>
  398.  
  399. <i class="icon-star"></i>
  400.  
  401. <i class="icon-star"></i>
  402.  
  403. <i class="icon-star"></i>
  404.  
  405. <i class="icon-star-empty"></i>
  406.  
  407. </span>';}
  408.  
  409.  
  410.  
  411. if ($rinter >= 65 && $rinter < 74) {return ' <span class="rating_star">
  412.  
  413. <i class="icon-star"></i>
  414.  
  415. <i class="icon-star"></i>
  416.  
  417. <i class="icon-star"></i>
  418.  
  419. <i class="icon-star-half"></i>
  420.  
  421. <i class="icon-star-empty"></i>
  422.  
  423. </span>';}
  424.  
  425.  
  426.  
  427. if ($rinter >= 55 && $rinter < 64) {return ' <span class="rating_star">
  428.  
  429. <i class="icon-star"></i>
  430.  
  431. <i class="icon-star"></i>
  432.  
  433. <i class="icon-star"></i>
  434.  
  435. <i class="icon-star-empty"></i>
  436.  
  437. <i class="icon-star-empty"></i>
  438.  
  439. </span>';}
  440.  
  441.  
  442.  
  443. if ($rinter >= 45 && $rinter < 54) {return ' <span class="rating_star">
  444.  
  445. <i class="icon-star"></i>
  446.  
  447. <i class="icon-star"></i>
  448.  
  449. <i class="icon-star-half"></i>
  450.  
  451. <i class="icon-star-empty"></i>
  452.  
  453. <i class="icon-star-empty"></i>
  454.  
  455. </span>';}
  456.  
  457.  
  458.  
  459. if ($rinter >= 35 && $rinter < 44) {return ' <span class="rating_star">
  460.  
  461. <i class="icon-star"></i>
  462.  
  463. <i class="icon-star"></i>
  464.  
  465. <i class="icon-star-empty"></i>
  466.  
  467. <i class="icon-star-empty"></i>
  468.  
  469. <i class="icon-star-empty"></i>
  470.  
  471. </span>';}
  472.  
  473.  
  474.  
  475. if ($rinter >= 25 && $rinter < 34) {return ' <span class="rating_star">
  476.  
  477. <i class="icon-star"></i>
  478.  
  479. <i class="icon-star-half"></i>
  480.  
  481. <i class="icon-star-empty"></i>
  482.  
  483. <i class="icon-star-empty"></i>
  484.  
  485. <i class="icon-star-empty"></i>
  486.  
  487. </span>';}
  488.  
  489.  
  490.  
  491. if ($rinter >= 15 && $rinter < 24) {return ' <span class="rating_star">
  492.  
  493. <i class="icon-star"></i>
  494.  
  495. <i class="icon-star-empty"></i>
  496.  
  497. <i class="icon-star-empty"></i>
  498.  
  499. <i class="icon-star-empty"></i>
  500.  
  501. <i class="icon-star-empty"></i>
  502.  
  503. </span>';}
  504.  
  505.  
  506.  
  507. if ($rinter > 0 && $rinter < 14) {return ' <span class="rating_star">
  508.  
  509. <i class="icon-star-half"></i>
  510.  
  511. <i class="icon-star-empty"></i>
  512.  
  513. <i class="icon-star-empty"></i>
  514.  
  515. <i class="icon-star-empty"></i>
  516.  
  517. <i class="icon-star-empty"></i>
  518.  
  519. </span>';}
  520.  
  521.  
  522.  
  523. if ($rinter = 0 ) {return '';}
  524.  
  525. }
  526.  
  527.  
  528.  
  529.  
  530.  
  531. function tmnf_rating_cat() {
  532.  
  533. $rcat = get_post_meta(get_the_ID(), 'tmnf_rating_category', true);
  534.  
  535. $rcatcustom = get_post_meta(get_the_ID(), 'tmnf_rating_category_own', true);
  536.  
  537.  
  538.  
  539. if($rcatcustom){
  540.  
  541. return '<span class="nr customcat">'. $rcatcustom .'</span>';
  542.  
  543. }elseif($rcat){
  544.  
  545. return '<span class="nr '. $rcat .'">'. $rcat .'</span>';
  546.  
  547. } else { }
  548.  
  549.  
  550.  
  551. }
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559. // managed excerpt
  560.  
  561.  
  562.  
  563. function tmnf_excerptlength_teaser($length) {
  564.  
  565. return 90;
  566.  
  567. }
  568.  
  569. function tmnf_excerptlength_index($length) {
  570.  
  571. return 13;
  572.  
  573. }
  574.  
  575. function tmnf_excerptmore($more) {
  576.  
  577. return '...';
  578.  
  579. }
  580.  
  581.  
  582.  
  583. add_filter( 'wp_get_attachment_link', 'gallery_prettyPhoto');
  584.  
  585.  
  586.  
  587. // new excerpt function
  588.  
  589.  
  590.  
  591. function tmnf_excerpt($length_callback='', $more_callback='') {
  592.  
  593. global $post;
  594.  
  595. if(function_exists($length_callback)){
  596.  
  597. add_filter('excerpt_length', $length_callback);
  598.  
  599. }
  600.  
  601. if(function_exists($more_callback)){
  602.  
  603. add_filter('excerpt_more', $more_callback);
  604.  
  605. }
  606.  
  607. $output = get_the_excerpt();
  608.  
  609. $output = apply_filters('wptexturize', $output);
  610.  
  611. $output = apply_filters('convert_chars', $output);
  612.  
  613. $output = '<p>'.$output.'</p>';
  614.  
  615. echo $output;
  616.  
  617. }
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625. // Old Shorten Excerpt text for use in theme
  626.  
  627. function themnific_excerpt($text, $chars = 1620) {
  628.  
  629. $text = $text." ";
  630.  
  631. $text = substr($text,0,$chars);
  632.  
  633. $text = substr($text,0,strrpos($text,' '));
  634.  
  635. $text = $text."...";
  636.  
  637. return $text;
  638.  
  639. }
  640.  
  641.  
  642.  
  643. function trim_excerpt($text) {
  644.  
  645. return rtrim($text,'[...]');
  646.  
  647. }
  648.  
  649. add_filter('get_the_excerpt', 'trim_excerpt');
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659. // automatically add prettyPhoto rel attributes to embedded images
  660.  
  661.  
  662.  
  663. function gallery_prettyPhoto ($content) {
  664.  
  665.  
  666.  
  667. // add checks if you want to add prettyPhoto on certain places (archives etc).
  668.  
  669.  
  670.  
  671. return str_replace("<a", "<a rel='prettyPhoto[gallery]'", $content);
  672.  
  673.  
  674.  
  675. }
  676.  
  677.  
  678.  
  679. function insert_prettyPhoto_rel($content) {
  680.  
  681. $pattern = '/<a(.*?)href="(.*?).(bmp|gif|jpeg|jpg|png)"(.*?)>/i';
  682.  
  683. $replacement = '<a$1href="$2.$3" rel=\'prettyPhoto\'$4>';
  684.  
  685. $content = preg_replace( $pattern, $replacement, $content );
  686.  
  687. return $content;
  688.  
  689. }
  690.  
  691. add_filter( 'the_content', 'insert_prettyPhoto_rel' );
  692.  
  693.  
  694.  
  695.  
  696.  
  697. // function to display number of posts.
  698.  
  699. function getPostViews($postID){
  700.  
  701. $count_key = 'post_views_count';
  702.  
  703. $count = get_post_meta($postID, $count_key, true);
  704.  
  705. if($count==''){
  706.  
  707. delete_post_meta($postID, $count_key);
  708.  
  709. add_post_meta($postID, $count_key, '0');
  710.  
  711. return "0";
  712.  
  713. }
  714.  
  715. return $count.'';
  716.  
  717. }
  718.  
  719.  
  720.  
  721. // function to count views.
  722.  
  723. function setPostViews($postID) {
  724.  
  725. $count_key = 'post_views_count';
  726.  
  727. $count = get_post_meta($postID, $count_key, true);
  728.  
  729. if($count==''){
  730.  
  731. $count = 0;
  732.  
  733. delete_post_meta($postID, $count_key);
  734.  
  735. add_post_meta($postID, $count_key, '0');
  736.  
  737. }else{
  738.  
  739. $count++;
  740.  
  741. update_post_meta($postID, $count_key, $count);
  742.  
  743. }
  744.  
  745. }
  746.  
  747.  
  748.  
  749.  
  750.  
  751. // Add it to a column in WP-Admin
  752.  
  753. add_filter('manage_posts_columns', 'posts_column_views');
  754.  
  755. add_action('manage_posts_custom_column', 'posts_custom_column_views',5,2);
  756.  
  757. function posts_column_views($defaults){
  758.  
  759. $defaults['post_views'] = __('Views', 'themnific');
  760.  
  761. return $defaults;
  762.  
  763. }
  764.  
  765. function posts_custom_column_views($column_name, $id){
  766.  
  767. if($column_name === 'post_views'){
  768.  
  769. echo getPostViews(get_the_ID());
  770.  
  771. }
  772.  
  773. }
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781. // pagination
  782.  
  783.  
  784.  
  785. function pagination($prev = '&laquo;', $next = '&raquo;') {
  786.  
  787. global $wp_query, $wp_rewrite;
  788.  
  789. $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;
  790.  
  791. $pagination = array(
  792.  
  793. 'base' => @add_query_arg('paged','%#%'),
  794.  
  795. 'format' => '',
  796.  
  797. 'total' => $wp_query->max_num_pages,
  798.  
  799. 'current' => $current,
  800.  
  801. 'prev_text' => $prev,
  802.  
  803. 'next_text' => $next,
  804.  
  805. 'type' => 'plain'
  806.  
  807. );
  808.  
  809. if( $wp_rewrite->using_permalinks() )
  810.  
  811. $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' );
  812.  
  813.  
  814.  
  815. if( !empty($wp_query->query_vars['s']) )
  816.  
  817. $pagination['add_args'] = array( 's' => get_query_var( 's' ) );
  818.  
  819.  
  820.  
  821. echo paginate_links( $pagination );
  822.  
  823. };
  824.  
  825.  
  826.  
  827.  
  828.  
  829. //Breadcrumbs
  830.  
  831. function the_breadcrumb() {
  832.  
  833. if (!is_home()) {
  834.  
  835.  
  836.  
  837. echo '<a href="'. home_url().'">';
  838.  
  839. echo '<i class="icon-home"></i> ';
  840.  
  841. echo "</a> &raquo; ";
  842.  
  843. if (is_category() || is_single()) {
  844.  
  845. the_category(', ');
  846.  
  847. if (is_single()) {
  848.  
  849. echo " &raquo; ";
  850.  
  851. echo short_title('...', 7);
  852.  
  853. }
  854.  
  855. } elseif (is_page()) {
  856.  
  857. echo the_title();}
  858.  
  859. }
  860.  
  861. }
  862.  
  863.  
  864.  
  865.  
  866.  
  867. function attachment_toolbox($size = thumbnail) {
  868.  
  869.  
  870.  
  871. if($images = get_children(array(
  872.  
  873. 'post_parent' => get_the_ID(),
  874.  
  875. 'post_type' => 'attachment',
  876.  
  877. 'numberposts' => -1, // show all
  878.  
  879. 'post_status' => null,
  880.  
  881. 'post_mime_type' => 'image',
  882.  
  883. ))) {
  884.  
  885. foreach($images as $image) {
  886.  
  887. $attimg = wp_get_attachment_image($image->ID,$size);
  888.  
  889. $atturl = wp_get_attachment_url($image->ID);
  890.  
  891. $attlink = get_attachment_link($image->ID);
  892.  
  893. $postlink = get_permalink($image->post_parent);
  894.  
  895. $atttitle = apply_filters('the_title',$image->post_title);
  896.  
  897.  
  898.  
  899. echo '<p><strong>wp_get_attachment_image()</strong><br />'.$attimg.'</p>';
  900.  
  901. echo '<p><strong>wp_get_attachment_url()</strong><br />'.$atturl.'</p>';
  902.  
  903. }
  904.  
  905. }
  906.  
  907. }
  908.  
  909.  
  910.  
  911. if ( current_user_can('contributor') && !current_user_can('upload_files') )
  912.  
  913. add_action('admin_init', 'allow_contributor_uploads');
  914.  
  915.  
  916.  
  917. function allow_contributor_uploads() {
  918.  
  919. $contributor = get_role('contributor');
  920.  
  921. $contributor->add_cap('upload_files');
  922.  
  923. }
  924.  
  925.  
  926.  
  927.  
  928.  
  929. // meta sections
  930.  
  931. function tmnf_meta_small() {
  932.  
  933. ?>
  934.  
  935. <p class="meta meta_move">
  936.  
  937. <?php the_time(get_option('date_format')); ?> &bull;
  938.  
  939. <i class="icon-heart-empty"></i><?php echo getPostViews(get_the_ID()); ?>
  940.  
  941. <?php if(tmnf_ratings()){ ?> &bull; <?php echo tmnf_ratings(); } else { }?></p>
  942.  
  943. <?php
  944.  
  945. }
  946.  
  947.  
  948.  
  949. function tmnf_meta_small2() {
  950.  
  951. ?>
  952.  
  953. <p class="meta">
  954.  
  955. <?php the_time(get_option('date_format')); ?> &bull;
  956.  
  957. <i class="icon-heart-empty"></i><?php echo getPostViews(get_the_ID()); ?>
  958.  
  959. <?php if(tmnf_ratings()){ ?> &bull; <?php echo tmnf_ratings(); } else { }?></p>
  960.  
  961. <?php
  962.  
  963. }
  964.  
  965.  
  966.  
  967. function tmnf_meta() {
  968.  
  969. ?>
  970.  
  971. <p class="meta">
  972.  
  973. <?php the_time(get_option('date_format')); ?> &bull;
  974.  
  975. <?php the_category(', ') ?> &bull;
  976.  
  977. <i class="icon-heart-empty"></i><?php echo getPostViews(get_the_ID()); ?>
  978.  
  979. <?php if(tmnf_ratings()){ ?> &bull; <?php echo tmnf_ratings(); } else { }?></p>
  980.  
  981. <?php
  982.  
  983. }
  984.  
  985.  
  986.  
  987. function tmnf_meta_full() {
  988.  
  989. ?>
  990.  
  991. <p class="meta">
  992.  
  993. <?php _e('by','themnific');?> <?php the_author_posts_link(); ?> &bull;
  994.  
  995. <?php the_time(get_option('date_format')); ?> &bull;
  996.  
  997. <?php the_category(', ') ?> &bull;
  998.  
  999. <?php comments_popup_link( __('Comments (0)', 'themnific'), __('Comments (1)', 'themnific'), __('Comments (%)', 'themnific')); ?> &bull;
  1000.  
  1001. <i class="icon-heart-empty"></i><?php echo getPostViews(get_the_ID()); ?>
  1002.  
  1003. <?php if(tmnf_ratings()){ ?> &bull; <?php echo tmnf_ratings(); } else { }?></p>
  1004.  
  1005. <?php
  1006.  
  1007. }
  1008.  
  1009.  
  1010.  
  1011. function tmnf_meta_more() {
  1012.  
  1013. ?>
  1014.  
  1015. <p class="meta more">
  1016.  
  1017. <i class="icon-file-alt"></i> <?php the_category(', ') ?>
  1018.  
  1019. <a class="fr" href="<?php the_permalink(); ?>"><?php _e('Read More','themnific');?> <i class="icon-circle-arrow-right"></i></a></p>
  1020.  
  1021. <?php
  1022.  
  1023. }
  1024.  
  1025.  
  1026.  
  1027. ?>
  1028.  
  1029. <?php
  1030.  
  1031. remove_action('wp_head', 'wp_generator');
  1032.  
  1033. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement