• Здравствуйте!
    Может кто поможет.
    Пытался установить по инструкциям коды лайков («Мне нравиться») на блог вордпреса в сайдбаре. Пытался, пытался, но так ничего и не вышло.

    Тема Third Style. Может что-то с темой не так?

Просмотр 9 ответов — с 1 по 9 (всего 9)
  • Используй этот плагин http://wordpress.org/extend/plugins/share-buttons/ .
    Это очень простой в настройке и удобный плагин.

    Автор gartinger

    (@gartinger)

    Спасибо за ответ, но я не хотел перегружать блог пестрыми кнопками, просто хотел сделать в сайдбаре две кнопочки мне нравиться.

    Вот и собственно блог http://sniperman.ru/

    А ну если так…просто можно в стилях плагина свои кнопки подсунуть)))

    Автор gartinger

    (@gartinger)

    Вы имеете ввиду плагин Social Share Buttons for WordPress? Если да, то как это сделать. Потому что я ставил плагин, но он кнопки выводит после каждой статьи. А мне нужно только в сайдбаре, боковой колонке. То есть я бы так хотел. Вот и ковыряюсь 🙂

    Сайдбар обычно находится в файле sidebar.php. Нужно добавить туда свой код (который даёт вам вконтакте). Что именно у вас не получается?

    Тогда тебе проще будет сделать шаблон записи с встроенными в сайт бар ссылками, я подобное делал для одного заказа. Сделай копию файла шаблона page.php (если содержимое сайдбара в отдельном файле, то придется сделать копию файла sidebar.php(может быть другое название) и дописывать functions.php. А в сайдбар добавишь ссылку c картинкой. Конечно слегка гиморойный способ, но он того стоит для определенных записей можно делать, а для других например нет.
    Но если хочешь побыстрей, то есть вот такой вариант http://wordpress.org/extend/plugins/socialize-it/ .

    Автор gartinger

    (@gartinger)

    для апельсинова:

    по инструкции добавил часть кода в header.php перед закрывающимся тегом head. вот даю весь код header.php:

    <?php
    /**
     * The Header for our theme.
     *
     * Displays all of the <head> section and everything up till <div id="main">
     *
     * @package WordPress
     * @subpackage Third_Style
     * @since Third Style 1.0
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 */
    	global $page, $paged;
    
    	wp_title( '|', true, 'right' );
    
    	// Add the blog name.
    	bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s', 'thirdstyle' ), max( $paged, $page ) );
    
    	?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    <link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:regular,bold' rel='stylesheet' type='text/css'>
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <?php
    	/* We add some JavaScript to pages with the comment form
    	 * to support sites with threaded comments (when in use).
    	 */
    	if ( is_singular() && get_option( 'thread_comments' ) )
    		wp_enqueue_script( 'comment-reply' );
    
    	/* Always have wp_head() just before the closing </head>
    	 * tag of your theme, or you will break many plugins, which
    	 * generally use this hook to add elements to <head> such
    	 * as styles, scripts, and meta tags.
    	 */
    	wp_head();
    ?>
    <script type="text/javascript">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-29254859-1']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    __________________________________________________________________
    </script>
    <script type="text/javascript" src="http://userapi.com/js/api/openapi.js?49"></script>
    
    <script type="text/javascript">
      VK.init({apiId: API_ID, onlyWidgets: true});
    </script>
    __________________________________________________________________
    </head>
    
    <body <?php body_class(); ?>>
    <div id="wrapper" class="hfeed">
    	<div id="header" style="background:url(<?php header_image(); ?>) no-repeat top left;">
    		<div id="masthead">
    			<div id="branding" role="banner">
    	                <div id="pao_search"><?php get_search_form(); ?></div>
    				<?php $heading_tag = ( is_home() || is_front_page() ) ? 'div' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">
    					<span>
    						<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    					</span>
    				</<?php echo $heading_tag; ?>>
    				<div id="site-description"><?php bloginfo( 'description' ); ?></div>
    			</div><!-- #branding -->
    
    			<div id="access" role="navigation">
    			  <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    				<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'thirdstyle' ); ?>"><?php _e( 'Skip to content', 'thirdstyle' ); ?></a></div>
    				<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
    				<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    			</div><!-- #access -->
    		</div><!-- #masthead -->
    <div style="clear:both;"></div>
    	</div>
    <!-- #header -->
    
    	<div id="main"><code></code>
    
    дальше добавлял другую чать сгенерированного кода в sidebar.php, например как тут:

    <?php
    /**
    * The Sidebar containing the primary and secondary widget areas.
    *
    * @package WordPress
    * @subpackage Third_Style
    * @since Third Style 1.0
    */
    ?>

    <div id=»primary» class=»widget-area» role=»complementary»>
    <ul class=»xoxo»>

    <?php
    /* When we call the dynamic_sidebar() function, it’ll spit out
    * the widgets for that widget area. If it instead returns false,
    * then the sidebar simply doesn’t exist, so we’ll hard-code in
    * some default sidebar stuff just in case.
    */
    if ( ! dynamic_sidebar( ‘primary-widget-area’ ) ) : ?>

    <li id=»archives» class=»widget-container»>
    <h3 class=»widget-title»><?php _e( ‘Archives’, ‘thirdstyle’ ); ?></h3>

      <?php wp_get_archives( ‘type=monthly’ ); ?>

    <li id=»meta» class=»widget-container»>
    <h3 class=»widget-title»><?php _e( ‘Meta’, ‘thirdstyle’ ); ?></h3>

      <?php wp_register(); ?>

    • <?php wp_loginout(); ?>
    • <?php wp_meta(); ?>

    <?php endif; // end primary widget area ?>

    </div><!— #primary .widget-area —>
    ______________________________________________________
    <div id=»vk_like»></div>
    <script type=»text/javascript»>
    VK.Widgets.Like(«vk_like», {type: «button»});
    </script>
    ______________________________________________________
    <?php
    // A second sidebar for widgets, just because.
    if ( is_active_sidebar( ‘secondary-widget-area’ ) ) : ?>

    <div id=»secondary» class=»widget-area» role=»complementary»>
    <ul class=»xoxo»>
    <?php dynamic_sidebar( ‘secondary-widget-area’ ); ?>

    </div><!— #secondary .widget-area —>

    <?php endif; ?>
    `

    в другой части пихал код в разные части, но на блоге так ничего не отображалось…

    Автор gartinger

    (@gartinger)

    для Serval:

    Теперь ковыряюсь в http://wordpress.org/extend/plugins/socialize-it/ .

    Увидим :), что выйдет. Спасибо

    Автор gartinger

    (@gartinger)

    socialize-it тоже не отображается. Бред какой-то…

Просмотр 9 ответов — с 1 по 9 (всего 9)

Тема «Мне нравится вконтакте и фэйсбук» закрыта для новых ответов.