22nd February 2012, 21:52
#6
1 out of 1 members found this post helpful.
Iti voi arata un exemplu. Intra in index.php, cauta bucata asta de cod:
Cod PHP:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="postItem">
<div class="categs"><?php the_category(', ') ?></div>
<div class="meta">
<div><?php the_time('M j, Y') ?></div>
<div class="icoAuthor"><?php the_author_link(); ?></div>
<div class="icoComments"><?php comments_popup_link('No Comments', '1 Comment ', '% Comments'); ?></div>
</div>
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<?php the_content(__('Continue reading »')); ?>
</div>
<?php endwhile; ?>
in locul ei pui codul acesta:
Cod PHP:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="postItem">
<div class="categs"><?php the_category(', ') ?></div>
<div class="meta">
<div><?php the_time('M j, Y') ?></div>
<div class="icoAuthor"><?php the_author_link(); ?></div>
<div class="icoComments"><?php comments_popup_link('No Comments', '1 Comment ', '% Comments'); ?></div>
</div>
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<p><img src="<?php tp_the_product_field( 'image-url' ); ?>" alt="" /></p>
<p>Pret: <?php tp_the_product_field( 'price' ); ?></p>
<p>Brand: <?php tp_the_product_field( 'brand' ); ?></p>
<p>Descriere: <?php tp_the_product_field( 'description' ); ?></p>
</div>
<?php endwhile; ?>
In articolul de mai jos am explicat cat de cat cum se modifica o tema:
siteafiliere.com/modificarea-unei-teme-wordpress-pentru-afisarea-produselor-din-campaniile-2parale/
Daca nu te descurci, te pot ajuta (insa contra cost).
27th February 2012, 23:44
#8
1 out of 1 members found this post helpful.
Problema se reduce la a scoate imaginea atasata din post:
Cod PHP:
<?php the_post_thumbnail('large'); ?>
sau pentru versiunile mai vechi:
Cod PHP:
<?php
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
echo '<img src="' . $image[0] . '" alt="" />';
?>
28th February 2012, 00:19
#10
1 out of 1 members found this post helpful.
Rescriu exemplul anterior pentru a nu exista confuzii:
Cod PHP:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="postItem">
<div class="categs"><?php the_category(', ') ?></div>
<div class="meta">
<div><?php the_time('M j, Y') ?></div>
<div class="icoAuthor"><?php the_author_link(); ?></div>
<div class="icoComments"><?php comments_popup_link('No Comments', '1 Comment ', '% Comments'); ?></div>
</div>
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<?php the_post_thumbnail('large'); ?>
<p>Pret: <?php tp_the_product_field( 'price' ); ?></p>
<p>Brand: <?php tp_the_product_field( 'brand' ); ?></p>
<p>Descriere: <?php tp_the_product_field( 'description' ); ?></p>
</div>
<?php endwhile; ?>
Daca functia <?php the_post_thumbnail('large'); ?> nu afiseaza poza, poti testa si cu:
Cod PHP:
<?php
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
echo '<img src="' . $image[0] . '" alt="" />';
?>