-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6809195
commit aa2769e
Showing
5 changed files
with
98 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<section class="tutorials"> | ||
<h2 class="title">دوره های آموزشی</h2> | ||
<div class="row"> | ||
<?php | ||
$args = array( | ||
'post_type' => 'tutorial' | ||
); | ||
$query = new WP_Query($args); | ||
// The Loop | ||
if ($query->have_posts()) { | ||
while ($query->have_posts()) { | ||
$query->the_post(); | ||
$post_id = $query->get_the_ID(); | ||
?> | ||
<div class="tutorial"> | ||
<div class="thumbnail"> | ||
<a href="<?php echo get_the_permalink(); ?>"> | ||
<?php if (has_post_thumbnail($post_id)) { | ||
$thumbnail = get_the_post_thumbnail_url($post_id); | ||
} else { | ||
$thumbnail = get_template_directory_uri() . "/assets/images/no-thumbnail.png"; | ||
} ?> | ||
<img src="<?php echo $thumbnail; ?>" alt="<?php echo get_the_title(); ?>"> | ||
</a> | ||
</div> | ||
<div class="tutorial_body"> | ||
<a href="<?php echo get_the_permalink(); ?>"> | ||
<h2 class="tutorial_title"><?php echo get_the_title(); ?></h2> | ||
</a> | ||
<div class="row"> | ||
<span class="price_tag">11,300 تومان</span> | ||
</div> | ||
</div> | ||
</div> | ||
<?php | ||
} | ||
} else { | ||
// no tutorial found | ||
echo "<h3 class='text-center text-orange m-0'>دوره ای یافت نشد</h3>"; | ||
} | ||
/* Restore original Post Data */ | ||
wp_reset_postdata(); | ||
?> | ||
</div> | ||
</section> |