| [ Index ] |
PHP Cross Reference of PageLines Framework |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * Gets Comments Link based on ID 5 */ 6 function pl_get_comments_link( $post_id ){ 7 8 $num_comments = get_comments_number($post_id); 9 if ( comments_open() ){ 10 if($num_comments == 0){ 11 $comments = __('Add Comment', 'pagelines'); 12 } 13 elseif($num_comments > 1){ 14 $comments = $num_comments.' '. __( 'Comments', 'pagelines' ); 15 } 16 else{ 17 $comments ="1 Comment"; 18 } 19 $write_comments = '<a href="' . get_comments_link($post_id) .'">'. $comments.'</a>'; 20 } 21 else{$write_comments = '';} 22 23 return $write_comments; 24 25 } 26 27 /** 28 * Get just the WordPress thumbnail URL - False if not there. 29 */ 30 function pl_the_thumbnail_url( $post_id, $size = false ){ 31 32 if( has_post_thumbnail($post_id) ){ 33 34 $img_data = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), $size, false); 35 36 $a['img'] = ($img_data[0] != '') ? $img_data[0] : ''; 37 38 return $a['img']; 39 40 } else 41 return false; 42 } 43 44 /** 45 * Support optional WordPress functionality 'add_theme_support' 46 */ 47 add_action('after_setup_theme', 'pl_theme_support'); 48 49 /** 50 * 51 * @TODO document 52 * 53 */ 54 function pl_theme_support( ){ 55 56 add_theme_support( 'post-thumbnails' ); 57 add_theme_support( 'menus' ); 58 add_theme_support( 'automatic-feed-links' ); 59 60 } 61 62 /** 63 * Fix The WordPress Login Image URL 64 */ 65 add_filter('login_headerurl', 'fix_wp_login_imageurl'); 66 67 /** 68 * 69 * @TODO document 70 * 71 */ 72 function fix_wp_login_imageurl( $url ){ 73 return home_url(); 74 } 75 76 /** 77 * Fix The WordPress Login Image Title 78 */ 79 add_filter('login_headertitle', 'fix_wp_login_imagetitle'); 80 81 /** 82 * 83 * @TODO document 84 * 85 */ 86 function fix_wp_login_imagetitle( $url ){ 87 return get_bloginfo('name'); 88 } 89 90 /** 91 * Fix The WordPress Login Image Title 92 */ 93 if ( VPRO ) 94 add_action('login_head', 'pl_fix_login_image'); 95 96 /** 97 * 98 * @TODO document 99 * 100 */ 101 function pl_fix_login_image( ){ 102 103 $image_url = (ploption('pl_login_image')) ? ploption('pl_login_image') : PL_ADMIN_IMAGES . '/login-pl.png'; 104 105 $css = sprintf('body #login h1 a{background: url(%s) no-repeat top center;height: 80px;background-size:auto;}', $image_url); 106 107 inline_css_markup('pagelines-login-css', $css); 108 } 109 110 /** 111 * Fix The WordPress Favicon by Site Title 112 */ 113 add_action('admin_head', 'pl_fix_admin_favicon'); 114 115 /** 116 * 117 * @TODO document 118 * 119 */ 120 function pl_fix_admin_favicon( ){ 121 122 $image_url = (ploption('pagelines_favicon')) ? ploption('pagelines_favicon') : PL_ADMIN_IMAGES . '/favicon-pagelines.png'; 123 124 $css = sprintf('#wphead #header-logo{background: url(%s) no-repeat scroll center center;}', $image_url); 125 126 inline_css_markup('pagelines-wphead-img', $css); 127 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Sat Apr 6 23:00:27 2013 | Cross-referenced by PHPXref 0.7.1 |