Merge pull request #4365 from gregory-p/wordpress

Wordpress
This commit is contained in:
gregory-p
2020-10-22 01:31:28 +03:00
committed by GitHub
2 changed files with 16 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
<?php <?php
get_header(); get_header();
$posts = get_posts(); $posts = get_posts(['nopaging' => true]);
?> ?>
<div class="content no-pb"> <div class="content no-pb">
<div class="blog-page"> <div class="blog-page">

View File

@@ -2,19 +2,25 @@
/** /**
* Template Name: Home Page * Template Name: Home Page
*/ */
$posts = get_posts(['posts_per_page' => 3]);
get_header(); get_header();
?> ?>
<div class="content no-pb"> <div class="content no-pb">
<?php <?php the_content();?><!--home page content from wp admin wysiwyg -->
if (have_posts()): <div class="blog-page">
while (have_posts()): <div class="bp-list cat-all">
the_post(); <div class="cont">
the_content(); <?php foreach ($posts as $post): ?>
endwhile; <a href="<?=get_permalink(); ?>" class="bp-block <?php $categories = get_the_category(); foreach($categories as $category):?><?= $category->slug; ?> <?php endforeach;?>">
endif; <span class="bp-img" style="background-image: url(<?=get_the_post_thumbnail_url(); ?>);"></span>
?> <span class="bp-title"><span class="cont-overflow"><?=get_the_title($post); ?></span></span>
<span class="bp-description"><span class="cont-overflow"><?=get_the_excerpt(); ?></span></span>
</a>
<?php endforeach; ?>
</div>
</div>
</div>
</div> </div>
<?php <?php