Skip to content

Commit

Permalink
Merge pull request #470 from EarthJournalismNetwork/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
pamelars86 authored Apr 23, 2021
2 parents 207f405 + 8397bb8 commit 633c209
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 40 deletions.
5 changes: 5 additions & 0 deletions themes/jeo-theme/archive-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
// Start the Loop.
while ( have_posts() ) :
the_post(); ?>

<?php
$hide_post = get_post_meta(get_the_ID(), 'hide_in_discovery', true) == '1'? true : false;
if($hide_post) continue;
?>

<article class="project-card">
<a href="<?php the_permalink() ?>" class="project-card--wrapper">
Expand Down
2 changes: 1 addition & 1 deletion themes/jeo-theme/assets/javascript/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "./functionalities/video-repositioning";
import "./functionalities/header";
import "./functionalities/cover-block";
import "./functionalities/video-gallery";
import "./functionalities/image-gallery";
// import "./functionalities/image-gallery";
// import "./functionalities/search-filters";
import "./functionalities/tooltip";
import "./functionalities/link-dropdown";
Expand Down
7 changes: 7 additions & 0 deletions themes/jeo-theme/assets/scss/5-pages/_p-storymap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@
color: #F5F5F5;
}
}
}


.post-type-archive-storymap {
.taxonomy-description {
display: none;
}
}
1 change: 1 addition & 0 deletions themes/jeo-theme/classes/library_related-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ static function get_posts($post_id = null, $num = 3, $after = null, $before = nu

$query = new \WP_Query([
'post__in' => $ids,
'post__not_in' => [ $post_id ],
'post_type' => ['post'],
'posts_per_page' => -1,
'orderby' => 'post__in'
Expand Down
1 change: 1 addition & 0 deletions themes/jeo-theme/mix-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"/contentBox.js": "/contentBox.js",
"/embedTemplate.js": "/embedTemplate.js",
"/image-block.js": "/image-block.js",
"/image-gallery.js": "/image-gallery.js",
"/imageBlock.js": "/imageBlock.js",
"/imageGallery.js": "/imageGallery.js",
"/linkDropdown.js": "/linkDropdown.js",
Expand Down
29 changes: 24 additions & 5 deletions themes/jeo-theme/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion themes/jeo-theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Author: Hacklab
Author URI: https://newspack.blog
Description:
Requires at least: WordPress 4.9.6
Version: 1.3.1
Version: 1.4.0
License: GNU General Public License v2 or later
License URI: LICENSE
Template: newspack-theme
Expand Down
59 changes: 26 additions & 33 deletions themes/jeo-theme/template-parts/content/content-related-posts.php
Original file line number Diff line number Diff line change
@@ -1,39 +1,32 @@
<?php
$posts = guaraci\related_posts::get_posts(get_the_id(), 3)->posts;
$posts_ids = [];
foreach($posts as $key=>$value) {
array_push($posts_ids, $value->ID);
}

$posts_query_args['post__in'] = $posts_ids;

$related_posts = new \WP_Query($posts_query_args);
$posts = guaraci\related_posts::get_posts(get_the_ID(), 3)->posts;
?>
<?php if(sizeof($related_posts->posts) >= 3 && sizeof($posts_ids) != 0 && get_option('related_posts__use', false)): ?>
<div class="related-posts">
<p class="title-section"><?= __('Related Posts', 'jeo') ?></p>
<?php if (sizeof($posts) >= 3 && sizeof($posts) != 0 && get_option('related_posts__use', false)) : ?>
<div class="related-posts">
<p class="title-section"><?= __('Related Posts', 'jeo') ?></p>

<div class="posts">
<?php foreach($related_posts->posts as $key=>$value): ?>
<div class="post">
<?php if(get_the_post_thumbnail($value->ID)) : ?>
<div class="thumbnail">
<a class="thumbnail-inner" href="<?php echo get_permalink($value->ID) ?>" target="blank">
<?php echo get_the_post_thumbnail($value->ID) ?>
</a>
</div>
<?php endif ?>
<div class="entry-container">
<p class="title">
<a href="<?php echo get_permalink($value->ID) ?>" target="blank">
<?php echo $value->post_title ?>
</a>
</p>
<p class="date"><?php echo get_the_time('F j, Y', $value->ID); ?></p>
<p class="excerpt"><?php echo get_the_excerpt($value->ID) ?></p>
</div>
<div class="posts">
<?php foreach ($posts as $key => $value) : ?>
<div class="post">
<?php if (get_the_post_thumbnail($value->ID)) : ?>
<div class="thumbnail">
<a class="thumbnail-inner" href="<?php echo get_permalink($value->ID) ?>" target="blank">
<?php echo get_the_post_thumbnail($value->ID) ?>
</a>
</div>
<?php endforeach; ?>
<?php endif ?>
<div class="entry-container">
<p class="title">
<a href="<?php echo get_permalink($value->ID) ?>" target="blank">
<?php echo $value->post_title ?>
</a>
</p>
<p class="date"><?php echo get_the_time('F j, Y', $value->ID); ?></p>
<p class="excerpt"><?php echo get_the_excerpt($value->ID) ?></p>
</div>
</div>
</div>
<?php if ($key >= 2) break; ?>
<?php endforeach; ?>
</div>
</div>
<?php endif ?>
1 change: 1 addition & 0 deletions themes/jeo-theme/webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mix.sass(assets_dir + '/scss/app.scss', '').sourceMaps();
// Functionalities
mix.js(assets_dir + '/javascript/functionalities/search-filters.js', '');
mix.js(assets_dir + '/javascript/functionalities/image-block.js', '');
mix.js(assets_dir + '/javascript/functionalities/image-gallery.js', '');



Expand Down

0 comments on commit 633c209

Please sign in to comment.