Jump to content
php.lv forumi
Sign in to follow this  
Blumish

Wordpress sakuma lapas labojums

Recommended Posts

Sveiki!

 

Man irviens jautaajums.

Saadi izskataas mans wordpres dizains..:

post-4311-0-33243200-1292523384_thumb.png

 

Saakum lapaa radaas pedeejie 15 pievienotie rakti: to nosaukumi. Man vajadzeetu lai radiitu pedeejos piecus rakstus ar visu informaaciiju: raksta satturu,un pareejos 10 sadaa pat stabinu seciibaa tikai ar nosaukumiem...

 

Luuk ir galvenais fails kas izvada rakstus:

<?php get_header(); ?>
<div id="layout"><!-- BEGIN LAYOUT -->
<div class="layout-left">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Main Column') ) : else : ?>
	<div class="nowidget"><b>MAIN COLUMN</b>: <a href="<?php echo get_settings('home'); ?>/wp-admin/widgets.php/" target="_self" title="Click to add widgets"><b>Add Widgets</b></a></div> 
<?php endif; ?>
</div>
<div class="layout-middle">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Secondary Column') ) : else : ?>
	<div class="nowidget"><b>SECONDARY COLUMN</b>: <a href="<?php echo get_settings('home'); ?>/wp-admin/widgets.php/" target="_self" title="Click to add widgets"><b>Add Widgets</b></a></div>
<?php endif; ?>
</div>
<div class="layout-right">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Side Column') ) : else : ?>
	<div class="nowidget"><b>SIDE COLUMN</b>: <a href="<?php echo get_settings('home'); ?>/wp-admin/widgets.php/" target="_self" title="Click to add widgets"><b>Add Widgets</b></a></div>
<?php endif; ?>
</div>
</div><!-- END LAYOUT -->
<?php get_footer(); ?>

 

Ludzu kadu izlabot so failu un lai rezultats butu lidzig sim:

post-4311-0-94689600-1292523820_thumb.png

 

Paldies jau ieprieks..

forumam.bmp

Share this post


Link to post
Share on other sites

Pirmais jau kas, tev ir jāuztaisa wp loop while cikls, ar count 5, plus jāizvada ārā content saturs. Pirmajiem pieciem būs full, bet pārējiem būs tikai title ar linku. Šaubos, vai kāds no zinošiem gribēs līdzēt par velti, skarbi bet tā tas ir. Mums labāk, varbūt ne labāk, patiktu tev palīdzēt pašam to izdarīt, pa pavedienam šķetinot kodu, utt.. nevis to darīt for free, vai kā savādāk.

 

Un velns rakstot radās tev risinājums:

 

<?php if (have_posts()) : ?>
<?php $count = 0; ?>

<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>

<?php if ($count <= 2) : ?> // Noradam cik ierakstiem paradit pilno saturu

<h2><a class="permalink" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?></a></h2>  

<?php the_content(); ?> // Paradam pilno saturu diviem pirmajiem ierakstiem

<?php else : ?>

<h2><a class="permalink" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">       <?php the_title(); ?></a></h2>  // Parējie linki

<?php endif; ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

Share this post


Link to post
Share on other sites

Sveiks foxsk8

 

Kautkas nav, ievietoju tavu kodu savā lapā starp <?php get_header(); ?> un <?php get_footer(); ?> (lai butu dizains), bet kods nedarbojas. Pie count noradīju 5, bet radās visi pārējie arī, zem siem pieciem neveidojas pārējo rakstu lists.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...