رفتن به مطلب

قرار دادن کد های شبکه های اجتماعی در قالب سایت


esyoo

پست های پیشنهاد شده

با سلام

دوستان من می خوام کد های زیر رو در صفحه اصلی ، پست و در صفحات قرار بدم.می خوام در انتهای مطالب و در سمت چپ قرار بدم.(دقیقا مثل این صفحه)

ممنون میشم بگید دقیقا این کد ها رو کجا قرار بدم(هرچی می کشم از این ندونستن دانش PHP هست)


<?php
$template_directory_uri = get_template_directory_uri();
$post_url = get_permalink();
$post_title = get_the_title();
?>
<div class="social">
<a href="http://donbaleh.com/submit.php?url=<?php echo $post_url ?>&subject=<?php echo $post_title ?>" rel="nofollow" target="_blank"><img src="<?php echo $template_directory_uri . '/images/social/donbaleh.gif'; ?>" title="اشتراک گذاري در دنباله" alt="اشتراک گذاري در دنباله" width="16" height="16" /></a>
<a href="http://www.cloob.com/share/link/add?url=<?php echo $post_url ?>&title=<?php echo $post_title ?>" rel="nofollow" target="_blank"><img src="<?php echo $template_directory_uri . '/images/social/cloob.gif'; ?>" title="اشتراک گذاري در کلوب" alt="اشتراک گذاري در کلوب" width="16" height="16" /></a>
<a href="http://www.google.com/reader/link?url=<?php echo $post_url ?>&title=<?php echo $post_title ?>&srcUrl=<?php the_permalink() ?>&srcTitle=<?php the_title() ?>"><img src="<?php echo $template_directory_uri . '/images/social/googlereader.png'; ?>" title="اشتراک گذاري در گوگل ريدر" alt="اشتراک گذاري در گوگل ريدر" width="16" height="16" /></a>
<a href="https://twitter.com/home/?status=<?php echo $post_title ?>-<?php echo $post_url ?>" rel="nofollow" target="_blank"><img src="<?php echo $template_directory_uri . '/images/social/twitter.png'; ?>" title="اشتراک گذاري در توييتر" alt="اشتراک گذاري در توييتر" width="16" height="16" /></a>
<a href="http://compose.mail.yahoo.com/?Subject=<?php echo $post_title ?>&body=Link:<?php echo $post_url ?>" rel="nofollow" target="_blank"><img src="<?php echo $template_directory_uri . '/images/social/yahoomail.png'; ?>" title="ايميل از طريق ياهو" alt="ايميل از طريق ياهو" width="16" height="16" /></a>
<a href="https://mail.google.com/mail/?ui=2&view=cm&fs=1&tf=1&su=<?php echo $post_title ?>&body=Link:<?php echo $post_url ?>" rel="nofollow" target="_blank"><img src="<?php echo $template_directory_uri . '/images/social/gmail.png'; ?>" title="ايميل از طريق جيميل" alt="ايميل از طريق جيميل" width="16" height="12" /></a>
<a href="mailto:?subject=<?php echo $post_title ?>&body=<?php echo str_replace(" ","%20","من از اين مطلب لذت بردم، پيشنهاد مي کنم شما هم بخوانيد " ) . $post_url ?>" rel="nofollow"><img src="<?php echo $template_directory_uri . '/images/social/email.png'; ?>" title="ايميل کردن اين مطلب" alt="ايميل کردن اين مطلب" width="16" height="16" /></a>
</div>

فایل index.php


<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Cryout Creations
* @subpackage Mantra
*/
$mantra_options= mantra_get_theme_options();
foreach ($mantra_options as $key => $value) {
${"$key"} = $value ;
}
get_header(); ?>

<div id="container">
<?php get_sidebar(); ?>
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<?php mantra_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php mantra_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'mantra' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'mantra' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</div><!-- #container -->

<?php get_footer(); ?>

فایل single.php


<?php
/**
* The Template for displaying all single posts.
*
* @package Cryout Creations
* @subpackage mantra
* @since mantra 0.5
*/
get_header(); ?>
<section id="container">
<?php get_sidebar(); ?>
<div id="content" role="main">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">«' . _x( '', 'Previous post link', 'mantra' ) . '</span> %title' ); ?></div>
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '', 'Next post link', 'mantra' ) . '»</span>' ); ?></div>
</div><!-- #nav-above -->
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-meta">
<?php if(function_exists('the_views')) { the_views(); } ?>
<?php mantra_posted_on(); ?>
</div><!-- .entry-meta -->
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'mantra' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
<div id="entry-author-info">
<div id="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'mantra_author_bio_avatar_size', 60 ) ); ?>
</div><!-- #author-avatar -->
<div id="author-description">
<h2><?php printf( esc_attr__( 'About %s', 'mantra' ), get_the_author() ); ?></h2>
<?php the_author_meta( 'description' ); ?>
<div id="author-link">
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
<?php printf( __( 'View all posts by ','mantra').'%s <span class="meta-nav">→</span>', get_the_author() ); ?>
</a>
</div><!-- #author-link -->
</div><!-- #author-description -->
</div><!-- #entry-author-info -->
<?php endif; ?>
<div class="entry-utility">
<?php mantra_posted_in(); ?>
<?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-utility -->
</div><!-- #post-## -->
<div id="nav-below" class="navigation">
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">«' . _x( '', 'Previous post link', 'mantra' ) . '</span> %title' ); ?></div>
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '', 'Next post link', 'mantra' ) . '»</span>' ); ?></div>
</div><!-- #nav-below -->
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</section><!-- #container -->
<?php get_footer(); ?>

فایل page.php


<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Cryout Creations
* @subpackage mantra
* @since mantra 0.5
*/
get_header(); ?>
<section id="container">
<?php get_sidebar(); ?>
<div id="content" role="main">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_front_page() ) { ?>
<h2 class="entry-title"><?php the_title(); ?></h2>
<?php } else { ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php } ?>
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'mantra' ), 'after' => '</div>' ) ); ?>
<?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-content -->
</div><!-- #post-## -->
<?php if ( comments_open() ) { comments_template( '', true );} else { ?>
<p class="nocomments2"><?php _e( 'Comments are closed.', 'mantra' ); ?></p>

<?php } endwhile; ?>
</div><!-- #content -->
</section><!-- #container -->

<?php get_footer(); ?>

لینک به ارسال

اگر طبق چیزی که الان روی سایت شماست میخواین باید قبلاز کد زیر قرار بدین:

</div><!-- .entry-content -->

این php نیست ، شما باید html و مباحث طراحی رو یاد بگیرید ;)

لینک به ارسال

بله.این هم از ندونستن کل مبحث وب هست!من vba رو خوب بلدم ولی این مباحث را تا حالا وقت نشده برم طرفش.ان شالله با اتمام درس حتما به طور تخصصی پی گیر خواهم شدمخصوصا مبحثCSS

من این کار رو کردم ولی دقیقا می یاد زیر مطالب مرتبط.

هر کار کردم زیر نوشته ها نیامد.

راه حلی برای این کار پیشنهاد می کنید؟

لینک به ارسال

احتمالا چون مطالب مرتبط به اونجا هوک میشه این اتفاق میوفته.

مطالب مرتبط شما با افزونه هست یا خود پوسته این امکان رو داره؟

لینک به ارسال

افزونه رو غیرفعال کنید ببینید اگر درست شد باید از یک افزونه مشابه استفاده کنید.

البته میشه با دستکاری در کد افزونه هم فیکسش کرد ولی باید وقت گذاشت.

لینک به ارسال

کد را بعد از کدی که مرتضی گفت قرار دهید

برای افزونه هم از تابع بعد از کد اشتراک گذاری استفاده کنید

راهنماش در صفحه افزونه هست به صورت کامل

گزینه‌ای هم در تنظیمات داره برای غیر فعال کردن اتوماتیک افزونه

لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...