You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Актуальные контакты:
Telegram: @Nikker_web
E-Mail: tarasevich.email@gmail.com
Портфолио https://www.behance.net/d4d4186e
Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ
Актуальные контакты:
Telegram: @Nikker_web
E-Mail: tarasevich.email@gmail.com
Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ
Портфолио https://www.behance.net/d4d4186e
Question
vitaxastifler
Парни в общем мне нужно на гравной стр вывести имя рубрики,я нашёл код...
Но у меня он не выводится как я хочу
Вывожу я значит имя рубрики по <h4><?php $category = get_the_category(); echo $category[0]->cat_name; ?></h4>
Вот код:
<?php $shortname = "typographic"; ?> <div class="clear"></div> </section><!--//main_container--> <?php if(is_front_page()){ ?> <?php if(get_option($shortname.'_disable_slideshow','') != "Yes") { ?> <section id="slideshow_cont"> <?php if( function_exists('cyclone_slider') ) cyclone_slider('slider'); ?> </section><!--//slideshow_cont--> <div class="blue_line"></div> <div style="line-height: 25px;margin: 0 auto; width: 1000px;"> <?php $posts = get_posts ("category=6&orderby=date&numberposts=322"); ?><h4><?php $category = get_the_category(); echo $category[0]->cat_name; ?></h4> <?php if ($posts) : ?> <?php foreach ($posts as $post) : setup_postdata ($post); ?> <div class="block1"> <ul> <a href="<?php the_permalink() ?>" rel="bookmark"><?php echo get_the_post_thumbnail($post->ID, 'thumbnail'); ?><div class="qq"><?php the_title(); ?></div> </a></ul> </div> <?php endforeach; ?> <?php endif; ?> </div> <div class="blue_line"></div> <div style="line-height: 25px;margin: 0 auto; width: 1000px;"> <?php $posts = get_posts ("category=7&orderby=date&numberposts=322"); ?><h4><?php $category = get_the_category(); echo $category[0]->cat_name; ?></h4> <?php if ($posts) : ?> <?php foreach ($posts as $post) : setup_postdata ($post); ?> <div class="block1"> <ul> <a href="<?php the_permalink() ?>" rel="bookmark"><?php echo get_the_post_thumbnail($post->ID, 'thumbnail'); ?><div class="qq"><?php the_title(); ?></div> </a></ul> </div> <?php endforeach; ?> <?php endif; ?> </div> <div class="blue_line"></div> <div style="line-height: 25px;margin: 0 auto; width: 1000px;"> <?php $posts = get_posts ("category=8&orderby=date&numberposts=322"); ?><h4><?php $category = get_the_category(); echo $category[0]->cat_name; ?></h4> <?php if ($posts) : ?> <?php foreach ($posts as $post) : setup_postdata ($post); ?> <div class="block1"> <ul> <a href="<?php the_permalink() ?>" rel="bookmark"><?php echo get_the_post_thumbnail($post->ID, 'thumbnail'); ?><div class="qq"><?php the_title(); ?></div> </a></ul> </div> <?php endforeach; ?> <?php endif; ?> </div> <div class="blue_line"></div> <div class="info"> <?php $post = get_post($post_id = 211); echo '<p>'.$post->post_content.'</p>'; ?></div> <?php } } ?> <div class="footer-wrapp"> <div class="blue_line1"></div> © 2014 «Kelma.ck.ua» - ремонт, монтаж, и замена любого электрооборудования в Черкассах и области </div> <?php wp_footer(); ?> </body> </html>Но проблема в том что визуально мне выводит вот так:
http://hostingkartinok.com/show-image.php?id=54685e0ccb1b65f554e381796a24ab2c
А мне нужно
http://hostingkartinok.com/show-image.php?id=bce253d4effd214dc3fe69fe02c9b322
Я не понимаю почему у меня 2-а раза электрика выводится и потом сантехника,а должно внутр работы.
Когда выводил описание рубрики выводило как положено,но увы описание рубрики мне ещё пригодиться не тут...
Edited by vitaxastiflerLink to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.