Как добавить в тело статьи - рубрики и комментарии

(Ответов: 6, Просмотров: 1130)
  1. Гуру Аватар для invest01
    • Регистрация: 10.12.2010
    • Сообщений: 833
    • Записей в дневнике: 2
    • Репутация: 46
    В общем новая проблема, нужно добавить где сейчас метки, отображение количества комментариев, а там где автор - рубрики.

    Как это сделать? Где? (ворпресс)




    И шрифты по этой технической информации, как переделать и на какие лучше (чтобы не сливалось с текстом статьи)
    Последний раз редактировалось invest01; 25.07.2012 в 16:35.
    • 0
  2. Дипломник Аватар для kcjbar
    • Регистрация: 19.09.2011
    • Сообщений: 182
    • Репутация: 13
    • Webmoney BL: ?
    В фауле archive.php или category.php (в зависимости от того чем выводите этустраницу)
    - Там где хотите категории вставляете <?php the_category(', ') ?>
    - Там где хотите комментарии <?php comments_popup_link('0', '1 ', ' %'); ?>
    • 1

    Спасибо сказали:

    invest01(26.07.2012),
  3. Гуру Аватар для invest01
    • Регистрация: 10.12.2010
    • Сообщений: 833
    • Записей в дневнике: 2
    • Репутация: 46
    kcjbar, спасибо, пробую.

    на другом форуме вот так подсказали:

    В шаблоне: для главной странице файл index.php, для поста - single.php. Шрифты в файле с расширением .css
    Если не разбираетесь в шаблонах придется потратить время на гугление и вникание, либо отдать небольшую денежку тому, кто разбирается.
    • 0
  4. Гуру Аватар для invest01
    • Регистрация: 10.12.2010
    • Сообщений: 833
    • Записей в дневнике: 2
    • Репутация: 46
    В общем в этих файлах ничего не нашел, есть вот этот файл - функции темы..
    посмотрите, может где здесь что изменить?

    Код:
    <?php
    function reverie_setup() {
    	// Add language supports. Please note that Reverie Framework does not include language files.
    	load_theme_textdomain('reverie', get_template_directory() . '/lang');
    	
    	// Add post thumbnail supports. http://codex.wordpress.org/Post_Thumbnails
    	add_theme_support('post-thumbnails');
    	// set_post_thumbnail_size(150, 150, false);
    	
    	// Add post formarts supports. http://codex.wordpress.org/Post_Formats
    	add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));
    	
    	// Add menu supports. http://codex.wordpress.org/Function_Reference/register_nav_menus
    	add_theme_support('menus');
    	register_nav_menus(array(
    		'primary_navigation' => __('Primary Navigation', 'reverie'),
    		'utility_navigation' => __('Utility Navigation', 'reverie')
    	));	
    }
    add_action('after_setup_theme', 'reverie_setup');
    
    // create widget areas: sidebar, footer
    $sidebars = array('Sidebar');
    foreach ($sidebars as $sidebar) {
    	register_sidebar(array('name'=> $sidebar,
    		'before_widget' => '<article id="%1$s" class="row widget %2$s"><div class="sidebar-section twelve columns">',
    		'after_widget' => '</div></article>',
    		'before_title' => '<h6><strong>',
    		'after_title' => '</strong></h6>'
    	));
    }
    $sidebars = array('Footer');
    foreach ($sidebars as $sidebar) {
    	register_sidebar(array('name'=> $sidebar,
    		'before_widget' => '<article id="%1$s" class="four columns widget %2$s"><div class="footer-section">',
    		'after_widget' => '</div></article>',
    		'before_title' => '<h6><strong>',
    		'after_title' => '</strong></h6>'
    	));
    }
    
    // return entry meta information for posts, used by multiple loops.
    function reverie_entry_meta() {
    	echo '<time class="updated" datetime="'. get_the_time('c') .'" pubdate>'. sprintf(__('Опубликовано %s at %s.', 'reverie'), get_the_time('l, F jS, Y'), get_the_time()) .'</time>';
    	echo '<p class="byline author vcard">'. __('Written by', 'reverie') .' <a href="'. get_author_posts_url(get_the_author_meta('id')) .'" rel="author" class="fn">'. get_the_author() .'</a></p>';
    }
    
    /* Customized the output of caption, you can remove the filter to restore back to the WP default output. Courtesy of DevPress. http://devpress.com/blog/captions-in-wordpress/ */
    add_filter( 'img_caption_shortcode', 'cleaner_caption', 10, 3 );
    
    function cleaner_caption( $output, $attr, $content ) {
    
    	/* We're not worried abut captions in feeds, so just return the output here. */
    	if ( is_feed() )
    		return $output;
    
    	/* Set up the default arguments. */
    	$defaults = array(
    		'id' => '',
    		'align' => 'alignnone',
    		'width' => '',
    		'caption' => ''
    	);
    
    	/* Merge the defaults with user input. */
    	$attr = shortcode_atts( $defaults, $attr );
    
    	/* If the width is less than 1 or there is no caption, return the content wrapped between the [caption]< tags. */
    	if ( 1 > $attr['width'] || empty( $attr['caption'] ) )
    		return $content;
    
    	/* Set up the attributes for the caption <div>. */
    	$attributes = ' class="figure ' . esc_attr( $attr['align'] ) . '"';
    
    	/* Open the caption <div>. */
    	$output = '<figure' . $attributes .'>';
    
    	/* Allow shortcodes for the content the caption was created for. */
    	$output .= do_shortcode( $content );
    
    	/* Append the caption text. */
    	$output .= '<figcaption>' . $attr['caption'] . '</figcaption>';
    
    	/* Close the caption </div>. */
    	$output .= '</figure>';
    
    	/* Return the formatted, clean caption. */
    	return $output;
    }
    
    // Clean the output of attributes of images in editor. Courtesy of SitePoint. http://www.sitepoint.com/wordpress-change-img-tag-html/
    function image_tag_class($class, $id, $align, $size) {
    	$align = 'align' . esc_attr($align);
    	return $align;
    }
    add_filter('get_image_tag_class', 'image_tag_class', 0, 4);
    function image_tag($html, $id, $alt, $title) {
    	return preg_replace(array(
    			'/\s+width="\d+"/i',
    			'/\s+height="\d+"/i',
    			'/alt=""/i'
    		),
    		array(
    			'',
    			'',
    			'',
    			'alt="' . $title . '"'
    		),
    		$html);
    }
    add_filter('get_image_tag', 'image_tag', 0, 4);
    
    // Customize the output of menus to fit the ZURB navigation style. Courtesy of Kriesi.at. http://www.kriesi.at/archives/improve-your-wordpress-navigation-menu-output
    class description_walker extends Walker_Nav_Menu
    {
    	function start_el(&$output, $item, $depth, $args)
    	{
    		global $wp_query;
    		$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
    		
    		$class_names = $value = '';
    		
    		$classes = empty( $item->classes ) ? array() : (array) $item->classes;
    		
    		$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
    		$class_names = ' class="'. esc_attr( $class_names ) . '"';
    		
    		$output .= $indent . '<dd id="menu-item-'. $item->ID . '-dd"' . $value . $class_names .'>';
    		
    		$attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';
    		$attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';
    		$attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';
    		$attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';
    		
    		$prepend = '';
    		$append = '';
    		$description  = ! empty( $item->description ) ? '' : '';
    		
    		if($depth != 0)
    		{
    			$description = $append = $prepend = "";
    		}
    		
    		$item_output = $args->before;
    		$item_output .= '<a'. $attributes .'>';
    		$item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
    		$item_output .= $description.$args->link_after;
    		$item_output .= '</a>';
    		$item_output .= $args->after;
    		
    		$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
    	}
    	function end_el(&$output, $item, $depth) {
    		$output .= "</dd>\n";
    	}
    }
    
    // img unautop, Courtesy of Interconnectit http://interconnectit.com/2175/how-to-remove-p-tags-from-images-in-wordpress/
    function img_unautop($pee) {
        $pee = preg_replace('/<p>\\s*?(<a .*?><img.*?><\\/a>|<img.*?>)?\\s*<\\/p>/s', '<figure>$1</figure>', $pee);
        return $pee;
    }
    add_filter( 'the_content', 'img_unautop', 30 );
    
    // Presstrends
    function presstrends() {
    
    // Add your PressTrends and Theme API Keys
    $api_key = 'xc11x4vpf17icuwver0bhgbzz4uewlu5ql38';
    $auth = 'kw1f8yr8eo1op9c859qcqkm2jjseuj7zp';
    
    // NO NEED TO EDIT BELOW
    $data = get_transient( 'presstrends_data' );
    if (!$data || $data == ''){
    $api_base = 'http://api.presstrends.io/index.php/api/sites/add/auth/';
    $url = $api_base . $auth . '/api/' . $api_key . '/';
    $data = array();
    $count_posts = wp_count_posts();
    $count_pages = wp_count_posts('page');
    $comments_count = wp_count_comments();
    $theme_data = get_theme_data(get_stylesheet_directory() . '/style.css');
    $plugin_count = count(get_option('active_plugins'));
    $all_plugins = get_plugins();
    foreach($all_plugins as $plugin_file => $plugin_data) {
    $plugin_name .= $plugin_data['Name'];
    $plugin_name .= '&';
    }
    $data['url'] = stripslashes(str_replace(array('http://', '/', ':' ), '', site_url()));
    $data['posts'] = $count_posts->publish;
    $data['pages'] = $count_pages->publish;
    $data['comments'] = $comments_count->total_comments;
    $data['approved'] = $comments_count->approved;
    $data['spam'] = $comments_count->spam;
    $data['theme_version'] = $theme_data['Version'];
    $data['theme_name'] = $theme_data['Name'];
    $data['site_name'] = str_replace( ' ', '', get_bloginfo( 'name' ));
    $data['plugins'] = $plugin_count;
    $data['plugin'] = urlencode($plugin_name);
    $data['wpversion'] = get_bloginfo('version');
    foreach ( $data as $k => $v ) {
    $url .= $k . '/' . $v . '/';
    }
    $response = wp_remote_get( $url );
    set_transient('presstrends_data', $data, 60*60*24);
    }}
    add_action('admin_init', 'presstrends');
    ?>
    • 0
  5. Инфа 100% Аватар для klimweb
    • Регистрация: 03.08.2011
    • Сообщений: 1,174
    • Репутация: 246
    • Webmoney BL: ?
    Цитата Сообщение от invest01 Посмотреть сообщение
    на другом форуме вот так подсказали
    развернутый ответ

    править нужно в index.php, single.php, functions.php и, если нужно, в page.php. Саша, свяжись со мной, сделаем
    Закажите бесплатную карточку ePayments с возможностью вывода WMZ. Место свободно
    • 1

    Спасибо сказали:

    invest01(26.07.2012),
  6. Гуру Аватар для invest01
    • Регистрация: 10.12.2010
    • Сообщений: 833
    • Записей в дневнике: 2
    • Репутация: 46
    Цитата Сообщение от klimweb Посмотреть сообщение
    править нужно в index.php, single.php, functions.php и, если нужно, в page.php. Саша, свяжись со мной, сделаем
    Спасибо Влад! Уже не актуально, помогли. Но глянь, я буду дизайн менять у швиндлера http://swindlernet.ru/blog/swindlernet/1.html

    может здесь есть желание поковыряться? хостинг отдельный, пароли, доступ, админку - все дам..
    Что думаешь?
    • 0
  7. Критик Аватар для Gami
    • Регистрация: 06.07.2010
    • Сообщений: 248
    • Репутация: 30
    invest01, Вы создаете сайты на WP и задаете довольно простые вопросы. Может имеет смысл самому поковырять тему сайта? Это очень просто когда разберетесь и не придется просить. Рано или поздно всеравно к этому придете. Без начальных знаний программирования сайты не построите или будете постоянно платить за пустяковую работу.
    • 0

Похожие темы

Темы Раздел Ответов Последний пост
"Фишки" для вставки контекстной рекламы в тело постов для увеличения дохода
Дайджест блогосферы 3 08.07.2011 08:48
как добавить фарма статьи в шопы от DRUGREVENUE
Партнерские программы 2 07.03.2010 10:02
Как вставить редирект в тело дорвея?
Вопросы от новичков 5 05.03.2010 12:14
Статьи и комментарии могут убить ваш блог! Будьте внимательней!
Блоги 126 09.12.2009 17:49

У кого попросить инвайт?

Вы можете попросить инвайт у любого модератора:

Информеры