( Zaloguj | Zarejestruj )
![]() ![]() |
26.8.2010 - 13:50
Post
#1
|
|
|
Grupa: Bloger Postów: 6 Nr: 8 750 |
Witam,
Chciałbym wyświetlać na stronie głównej fragment wiadomości. Niby żaden problem, istnieją wtyczki, można to skonfigurować, gdzie tekst zostaje obcięty. Problem w tym, że chciałbym przyciąć górną część wpisu, np: dane o recenzowanej książce - wydawnictwo, autor, data wydania i wyświetlać fragment od właściwej części recenzji. Czy mógłbym liczyć na Waszą pomoc? |
|
|
|
26.8.2010 - 13:55
Post
#2
|
|
![]() aktywność: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Grupa: Redakcja Postów: 4 252 Nr: 5 919 |
Podaj linka do strony, oraz jakiś przykładowy wpis zaprezentuj jak ma wyglądać na stronie głównej, i jak ma wyglądać jego pełna część.
|
|
|
|
26.8.2010 - 14:44
Post
#3
|
|
![]() aktywność: ![]() ![]() ![]() ![]() Grupa: +Bloger Postów: 295 Nr: 7 102 |
Skorzystaj z tagu more, czyli w miejscu, w którym ma zakończyć się treść wyświetlana na stronie głównej wstaw
KOD <!--more--> Musisz to zrobić w edytorze html oczywiście -------------------- |
|
|
|
26.8.2010 - 14:48
Post
#4
|
|
|
Grupa: Bloger Postów: 6 Nr: 8 750 |
moja strona to http://kapryfolium.pl
W rozwiniętej notce możecie zobaczyć okładkę po lewej i przypisy po prawej stronie. W skróconym wpisie niestety całość zlewa się w ciągły tekst, a chciałbym wykluczyć ten tekst po prawej, który mam w tabelce. |
|
|
|
26.8.2010 - 17:17
Post
#5
|
|
![]() aktywność: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Grupa: Redakcja Postów: 4 252 Nr: 5 919 |
macio76 > przeczytaj dokładnie jego posta, nie o to mu chodzi.
vincent4 > widzę że coś psujesz na stronie, daj znać jak już będzie działać. |
|
|
|
26.8.2010 - 17:47
Post
#6
|
|
|
Grupa: Bloger Postów: 6 Nr: 8 750 |
vincent4 > widzę że coś psujesz na stronie, daj znać jak już będzie działać. Hah, nie. Mam pecha - wczoraj kupiłem hosting i domenę a dziś przysłali maila, że w związku ze zmianą udziałowca nie mogą dalej korzystać z tej domeny i zmieniają nazwę. Pewnie teraz remont generalny i zamieszanie. Ogromne dzięki za zainteresowanie, dam znać od razu jak coś ruszy |
|
|
|
30.8.2010 - 23:28
Post
#7
|
|
|
Grupa: Bloger Postów: 6 Nr: 8 750 |
Odświeżam temat..
Strona już działa - kapryfolium.pl Można zobaczyć, jak na stronie głównej robi sieczkę z tekstu, po otworzeniu tekst ląduje ładnie w tabelce. Chciałbym więc skrócić wersję skróconą, ale nie od dołu, tylko od góry, zaczynając od tekstu pod tabelką. |
|
|
|
31.8.2010 - 08:35
Post
#8
|
|
![]() aktywność: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Grupa: Redakcja Postów: 4 252 Nr: 5 919 |
Ok, więc tak - proponuję Ci skorzystać z pola zajawki/wypisu, zwał jak zwał ( znajduje się ono pod głównym polem do uzupełniania treści wpisu ). Tam wpisz to co ma się wyświetlać na stronie głównej ... i następnie, w pliku index.php/home.php, zamień funkcję the_content() na the_excerpt();
|
|
|
|
31.8.2010 - 09:52
Post
#9
|
|
|
Grupa: Bloger Postów: 6 Nr: 8 750 |
Niestety, całość jest inaczej skonstruowana. W index jest odwołanie do entry.php a tam nie ma tego zwrotu, treść jest wprowadzana inaczej.
Może chciałbyś zerknąć? - http://www.sendspace.com/file/e8383q |
|
|
|
31.8.2010 - 11:26
Post
#10
|
|
![]() aktywność: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Grupa: Redakcja Postów: 4 252 Nr: 5 919 |
Zamieść kod w tagach code.
|
|
|
|
31.8.2010 - 11:32
Post
#11
|
|
|
Grupa: Bloger Postów: 6 Nr: 8 750 |
index.php
CODE <?php get_header(); ?> <?php if (is_archive()) $post_number = get_option('lightbright_archivenum_posts'); if (is_search()) $post_number = get_option('lightbright_searchnum_posts'); if (is_tag()) $post_number = get_option('lightbright_tagnum_posts'); if (is_category()) $post_number = get_option('lightbright_catnum_posts'); if (is_home()) $args=array( 'showposts'=>get_option('lightbright_homepage_posts'), 'paged'=>$paged, 'post_type' => array('note','photo','quote','video','customlink','audio','post') ); ?> <?php global $query_string; if (is_category()) query_posts($query_string . "&showposts=$post_number&paged=$paged&cat=$cat"); elseif (is_home()) query_posts($args); elseif (is_author()) { $qstring_array = array(); parse_str($query_string, $qstring_array); query_posts(array('showposts' => $post_number,'paged'=>$paged,'post_type' => array('note','photo','quote','video','customlink','audio'),'author'=>$qstring_array["author"])) ; } else query_posts($query_string . "&showposts=$post_number&paged=$paged"); ?> <?php if (isset($_REQUEST["post_type"])) { $args=array( 'showposts'=> get_option('lightbright_archive_customposts'), 'paged'=>$paged, 'post_type' => $_REQUEST["post_type"] ); query_posts($args); }; ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php include(TEMPLATEPATH . '/includes/entry.php'); ?> <?php endwhile; ?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> <?php include(TEMPLATEPATH . '/includes/navigation.php'); ?> <?php } ?> <?php else : ?> <?php include(TEMPLATEPATH . '/includes/no-results.php'); ?> <?php endif; wp_reset_query(); ?> </div> <!-- end #main-area --> <?php get_sidebar(); ?> <?php get_footer(); ?> entry.php CODE <?php $postType = 'text';
if('note' == $post->post_type) $postType = 'text'; if('video' == $post->post_type) $postType = 'video'; if('quote' == $post->post_type) $postType = 'quote'; if('photo' == $post->post_type) $postType = 'photo'; if('customlink' == $post->post_type) $postType = 'link'; if('audio' == $post->post_type) $postType = 'audio'; ?> <div class="entry<?php echo(" $postType"); ?>"> <div class="entry-top"></div> <?php include(TEMPLATEPATH . '/includes/share.php'); ?> <div class="post clearfix"> <div class="content clearfix"> <?php $custom = get_post_custom($post->ID); $link = ''; ?> <?php if ($postType == 'link') $link = isset($custom["customlink"][0]) ? $custom["customlink"][0] : ''; if ($link == '') $link = get_permalink(); ?> <a href="<?php if(isset($post->post_type)) echo(get_bloginfo('url') . '?post_type=' . $post->post_type); else echo('#'); ?>" class="bubble"><?php the_title(); ?></a> <h<?php if(!is_single()) echo('2'); else echo('1'); ?> class="title"><?php if(!is_single()) echo('<a href="'. $link .'">');?><?php the_title(); ?><?php if(!is_single()) echo('</a>'); ?></h<?php if(!is_single()) echo('2'); else echo('1'); ?>> <span class="date"><?php the_time('M d'); ?></span> <div class="clear"></div> <?php $thumb = ''; if ($postType == 'text' || $postType == 'photo') { if ($postType == 'text') { $width = 184; $height = 184; } if ($postType == 'photo') { $width = 445; $height = 299; } $classtext = ''; $titletext = get_the_title(); $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext,true,'thumb'); $thumb = $thumbnail["thumb"]; }; ?> <?php if (!is_single()) { ?> <?php if ($thumb <> '' && $postType == 'text' && get_option('lightbright_thumbnails_index') == 'on') { ?> <div class="small-thumb"> <a href="<?php echo $thumbnail["fullpath"]; ?>" class="fancybox"> <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext , $width, $height, $classtext); ?> <span class="overlay"></span> </a> </div> <?php }; ?> <?php if ($thumb <> '' && $postType == 'photo' && get_option('lightbright_thumbnails_index') == 'on') { ?> <div class="big-thumb"> <a href="<?php echo $thumbnail["fullpath"]; ?>" class="fancybox"> <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext , $width, $height, $classtext); ?> <span class="overlay"></span> </a> </div> <?php }; ?> <?php } else { ?> <?php if (get_option('lightbright_thumbnails') == 'on') { ?> <?php if ($thumb <> '' && $postType == 'text') { ?> <div class="small-thumb"> <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext , $width, $height, $classtext); ?> <span class="overlay"></span> </div> <?php }; ?> <?php if ($thumb <> '' && $postType == 'photo') { ?> <div class="big-thumb"> <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext , $width, $height, $classtext); ?> <span class="overlay"></span> </div> <?php }; ?> <?php }; ?> <?php }; ?> <?php if ($postType == 'quote') { ?> <blockquote> <p><?php $quote = isset($custom["quote"][0]) ? $custom["quote"][0] : ''; echo $quote; ?>”</p> <span class="quote_bg"></span> </blockquote> <?php }; ?> <?php if ($postType == 'video') { ?> <div class="video-block"> <?php $video = isset($custom["video"][0]) ? $custom["video"][0] : ''; $video_width = isset($custom["video_width"][0]) ? $custom["video_width"][0] : '424'; $video_height = isset($custom["video_height"][0]) ? $custom["video_height"][0] : '264'; ?> <?php $video = preg_replace("/height=\"[0-9]*\"/", "height=$video_height", $video); $video = preg_replace("/width=\"[0-9]*\"/", "width=$video_width", $video); echo $video; ?> </div> <!-- end .video-block --> <?php }; ?> <?php if ($postType == 'audio') { ?> <?php $audio = isset($custom["audio"][0]) ? $custom["audio"][0] : ''; ?> <div class="audio-block"> <?php $postID = $post->ID; ?> <p id="audioplayer_<?php echo($postID); ?>">Mp3 file</p> <script type="text/javascript"> AudioPlayer.embed("audioplayer_<?php echo $postID; ?>", {soundFile: "<?php echo $audio; ?>"}); </script> </div> <!-- end .audio-block --> <?php }; ?> <?php if ($postType == 'video') echo('<div class="video-text">'); ?> <?php if (get_option('lightbright_blog_style') == 'on' || is_single()) the_content(""); else { ?> <p><?php truncate_post(400); ?></p> <?php }; ?> <?php if ($postType == 'video') echo('</div> <!-- end .video-text -->'); ?> <?php if (is_single()) { ?> <?php wp_link_pages(array('before' => '<p><strong>'.__('Pages','LightBright').':</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php edit_post_link(__('Edit this page','LightBright')); ?> <?php }; ?> </div> <!-- end .content --> <div class="entry-bottom-top"></div> <div class="entry-meta clearfix"> <p class="meta"><span class="main"><?php _e('Posted by','LightBright');?> <?php the_author_posts_link(); ?> <?php $taxonomyName = 'custom-tax'; if ($postType == 'video') $taxonomyName = 'custom-tax2'; if ($postType == 'quote') $taxonomyName = 'custom-tax3'; if ($postType == 'photo') $taxonomyName = 'custom-tax4'; if ($postType == 'customlink') $taxonomyName = 'custom-tax5'; if ($postType == 'audio') $taxonomyName = 'custom-tax6'; ?> <?php echo get_the_term_list( $post->ID, $taxonomyName, __(' in ','LightBright'),', ' ); ?> </span> <span class="comment-count"><?php comments_popup_link('0','1','%'); ?></span></p> <?php if(!is_single()) { ?> <a href="<?php the_permalink(); ?>" class="readmore"><span><?php _e('Czytaj Dalej','LightBright'); ?></span></a> <?php }; ?> </div> <!-- end .entry-meta --> </div> <!-- end .main --> <div class="entry-bottom"></div> </div> <!-- end .entry --> <?php if (get_option('lightbright_468_enable') == 'on') { ?> <?php if(get_option('lightbright_468_adsense') <> '') echo(get_option('lightbright_468_adsense')); else { ?> <a href="<?php echo(get_option('lightbright_468_url')); ?>"><img src="<?php echo(get_option('lightbright_468_image')); ?>" alt="468 ad" class="foursixeight" /></a> <?php } ?> <?php } ?> <?php if (get_option('lightbright_show_postcomments') == 'on') comments_template('', true); ?> |
|
|
|
![]() ![]() |
| : 9 02 12 - 12:02 |