← WordPress

Colocar botão Gosto ao lado dos títulos dos artigos

Lida 3754 vezes

Offline

TEkN0 
Membro
Mensagens 83 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 50 Posts 10 Posts First Post Karma

Bom dia,

Gostaria de colocar um Botão Gosto ao lado dos títulos de todos os artigos do meu blog só que não sei onde mexer, porque já consegui colocar dentro do artigo mesmo mas na homepage aparece sem o botão, já procurei tudo e mais alguma coisa e não encontro nada...

Dentro do artigo foi só modificar o content.php e acrescentar o botão a seguir a "<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title() ?></a>"

Mas agora para também aparecer na homepage não sei onde mexer pois não encontro onde acrescentar o código do botão... E já esgotei a paciência...

Deixo aqui o exemplo: http://www.votobranco.com/?p=74
Conforme poderão reparar na homepage não aparece nada: www.votobranco.com
Obrigado
Offline

jcurinha 
Membro
Mensagens 16 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Signature Karma

Não te chateies, sem stress...
 
Testa o Add This é um site que oferece um serviço de bookmarking social gratuito que permite que seus visitantes  compartilhem seu site em redes sociais como o Twitter, Digg, MySpace, Facebook, Delicious,etc
http://www.addthis.com/

Outro idêntico é o wibiya : http://wibiya.conduit.com/?ref=L

Abraço
JC
Offline

TEkN0 
Membro
Mensagens 83 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 50 Posts 10 Posts First Post Karma

Obrigado pela tua resposta,

O próprio tema já traz esse plugin só que desinstalei-o pois fica bastante pesado daí eu ter optado pela via manual..

A única coisa que preciso é saber onde modificar o título dos artigos na homepage para colocar lá o código do facebook porque além do botão gosto vou querer adicionar mais coisas como o número de comentários.

Abraço
Offline

Octávio Alves 
Membro
Mensagens 963 Gostos 36
Feedback +25

Troféus totais: 27
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Boa tarde,

Tens de alterar no index.php.
Depois é só procurares o mesmo código que mencionaste em cima.

Cumprimentos
Offline

TEkN0 
Membro
Mensagens 83 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 50 Posts 10 Posts First Post Karma

Boas,

curiosamente o tema não utiliza index.php mas sim home.php, já tinha procurado e alterado algumas coisas por lá mas sem sucesso deixo aqui o código do home.php:
/**
 * AR2's home template.
 *
 * @package AR2
 * @since 1.0
 */
?>
<?php get_header(); ?>

<div id="content" class="section" role="main">
<?php ar2_above_content() ?>


<?php if ( !$paged ) : ?>

<?php ar2_render_zone( 'home' ) ?>

<?php if ( is_active_sidebar( 'Bottom Content #1' ) ) : ?>
<div class="bottom-sidebar" id="bottom-content-1" role="complementary">
   <?php if ( !dynamic_sidebar( 'Bottom Content #1' ) ) : ?>
   <?php endif; ?>
</div>

<?php endif ?>

<?php if ( is_active_sidebar( 'Bottom Content #2' ) ) : ?>
<div class="bottom-sidebar" id="bottom-content-2" role="complementary">
   <?php if ( !dynamic_sidebar( 'Bottom Content #2' ) ) : ?>
   <?php endif; ?>
</div>
<?php endif ?>

<?php else: ?>

<h1 class="archive-title"><?php _e( 'Blog Archives', 'ar2' ) ?></h1>
<div id="archive-posts">
<?php ar2_render_posts( null, array ( 'type' => ar2_get_theme_option( 'archive_display' ) ), true ) ?>
</div><!-- #archive-posts -->

<?php endif; ?>

<?php ar2_below_content() ?>
</div><!-- #content -->
   
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Offline

Octávio Alves 
Membro
Mensagens 963 Gostos 36
Feedback +25

Troféus totais: 27
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

O problema está aqui:

<h1 class="archive-title"><?php _e( 'Blog Archives', 'ar2' ) ?></h1>
<div id="archive-posts">
<?php ar2_render_posts( null, array ( 'type' => ar2_get_theme_option( 'archive_display' ) ), true ) ?>
</div><!-- #archive-posts -->

Ele vai buscar automáticamente todo o conteúdo.
Vê nas functions se tens lá o arquive-posts ou arquive_display
Se encontrares, é aí que tens de mudar.
Offline

TEkN0 
Membro
Mensagens 83 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 50 Posts 10 Posts First Post Karma

Obrigado, andei lá a ver mas não encontrei nada deixo aqui o código da functions.php

"<?php
define ( 'AR2_CHILD', is_child_theme() );
define ( 'AR2_VERSION' , wp_get_theme()->get( 'Version' ) );
define ( 'AR2_LIB', get_template_directory() . '/library' );

// Set this to true if you wish to use custom stylesheets.
// CSS files have to be placed in /css/styles/ folder.
define( 'AR2_ALLOW_CUSTOM_STYLES', false );

do_action( 'ar2_init' );

/**
 * Theme setup function - to be run during 'after_setup_theme' action hook.
 * @since 1.6
 */
add_action( 'after_setup_theme', 'ar2_setup', 10 );

if ( !function_exists('ar2_setup') ) :

function ar2_setup() {

   /* Load theme options */
   require_once AR2_LIB . '/options.php';
   
   /* Post Views API */
   require_once AR2_LIB . '/postviews.php';
   
   /* Load theme library files */
   require_once AR2_LIB . '/actions.php';
   require_once AR2_LIB . '/filters.php';
   require_once AR2_LIB . '/template.php';
   require_once AR2_LIB . '/thumbnails.php';
   require_once AR2_LIB . '/styles.php';
   require_once AR2_LIB . '/widgets.php';
   
   //require_once AR2_LIB . '/shortcodes.php';

   require_once AR2_LIB . '/admin/form.php';
   require_once AR2_LIB . '/admin/admin.php';

   /* Langauge support */
   load_theme_textdomain( 'ar2', get_template_directory() . '/language' );
   
   $locale = get_locale();
   $locale_file = get_template_directory() . "/languages/$locale.php";
   if ( is_readable( $locale_file ) )
      require_once( $locale_file );
   
   /* Theme support */
   add_theme_support( 'post-thumbnails' );
   add_theme_support( 'nav-menus' );
   add_theme_support( 'automatic-feed-links' );
   add_theme_support( 'custom-background', array (
      'default-color'      => 'F0F0F0',
      'wp-head-callback'   => 'ar2_custom_bg_header_callback',
   ) );
   add_theme_support( 'custom-header', array (
      'width'                  => 960,
      'height'               => 120,
      'default-text-color'      => '333',
      'wp-head-callback'         => 'ar2_header_style',
      'admin-head-callback'      => 'ar2_admin_header_style',
      'admin-preview-callback'   => 'ar2_admin_header_image',
   ) );
   add_theme_support( 'post-formats', array (
      'gallery', 
      'image',
      'video',
      'audio',
   ) );
   
   /* Menus locations */
   register_nav_menus( array (
      'main-menu'      => __( 'Main Menu', 'ar2' ),
      'top-menu'      => __( 'Top Menu', 'ar2' ),
      'footer-nav'   => __( 'Footer Navigation', 'ar2' )
   ));
   
   /* Register sidebars */
   ar2_add_sidebars();
   
   /* Header actions */
   remove_action( 'wp_head', 'pagenavi_css' );
   
   add_action( 'wp_footer', 'ar2_add_header_js', 100 );
   
   // Editor Style
   add_editor_style();

   /* Thumbnail sizes */
   ar2_add_theme_thumbnails();
   
   /* Max image size */
   $max_image_size = ar2_post_thumbnail_size();
   $content_width = $max_image_size[ 0 ];
   
   set_post_thumbnail_size( $max_image_size[ 0 ], $max_image_size[ 1 ] );
   
   // print_r($ar2_options);
   
}

endif;

/**
 * Sidebar setup function.
 * @since 1.6
 */
function ar2_add_sidebars() {
   
   /* Default sidebars */
   register_sidebar( array(
      'name' => __( 'Primary Sidebar', 'ar2' ),
      'id' => 'primary-sidebar',
      'before_widget' => '<aside id="%1$s" class="%2$s widget clearfix">',
      'after_widget' => '</aside>',
      'before_title' => '<h3 class="widget-title">',
      'after_title' => '</h3>'
   ) );
   register_sidebar( array(
      'name' => __( 'Bottom Content #1', 'ar2' ),
      'id' => 'bottom-content-1',
      'before_widget' => '<aside id="%1$s" class="%2$s widget clearfix">',
      'after_widget' => '</aside>',
      'before_title' => '<h3 class="widget-title">',
      'after_title' => '</h3>'
   ) );
   register_sidebar( array(
      'name' => __( 'Bottom Content #2', 'ar2' ),
      'id' => 'bottom-content-2',
      'before_widget' => '<aside id="%1$s" class="%2$s widget clearfix">',
      'after_widget' => '</aside>',
      'before_title' => '<h3 class="widget-title">',
      'after_title' => '</h3>'
   ) );
   
   /* Footer sidebars (4 sidebars) */
   $footer_sidebars = 4;
   
   for( $i = 1; $i < $footer_sidebars + 1; $i++ ) {
      register_sidebar( array(
         'name' => sprintf( __( 'Footer Sidebar #%s', 'ar2' ), $i ),
         'id' => 'footer-sidebar-' . $i,
         'before_widget' => '<aside id="%1$s" class="%2$s widget clearfix">',
         'after_widget' => '</aside>',
         'before_title' => '<h3 class="widget-title">',
         'after_title' => '</h3>'
      ) );
   }
         
}
 
/* End of file functions.php */
/* Location: ./functions.php */"