Skip to content

Commit

Permalink
Merge pull request #1703 from megabulk/megabulk-patch-1
Browse files Browse the repository at this point in the history
added template hook to category page, after div.primary-featured-post…
  • Loading branch information
benlk committed May 22, 2019
2 parents 1f4cecf + d8a52fe commit 06cdb06
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@

<div class="row-fluid clearfix">
<div class="stories span8" role="main" id="content">
<?php do_action( 'largo_archive_before_stories' ); ?>
<?php
// and finally wind the posts back so we can go through the loop as usual
rewind_posts();
Expand Down
6 changes: 4 additions & 2 deletions category.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
); ?>
</div>

<?php

<?php

do_action( 'largo_category_after_primary_featured_post' );

/*
* NOTE: If you are trying to accomplish something other than displaying no featured posts
* or displaying 5 featured posts, you will need to modify the `largo_category_archive_posts` function
Expand Down
14 changes: 9 additions & 5 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ though this project doesn't succeed in adhering to [Semantic Versioning](https:/

## [Largo 0.6.4](https://github.com/INN/largo/compare/v0.6.3...v0.6.4)

## Fixes and minor improvements
### Developer-facing improvements

- Updated `largo_home_single_top` function to get `homepage_feature_term` and `top_story_term` values from slug
instead of by name. If these prominence names were updated to anything else, ``homepage_feature_term`` and `top_story_term` would be false and fallback to `__('Homepage Featured', 'largo')`. [Pull request #1709](https://github.com/INN/largo/pull/1709) for [issue #1445](https://github.com/INN/largo/issues/1445).
- Removed separator span on search results page to be able to put the search result url on a new line instead of next to the date. Also added `overflow-wrap: breakword;` to result url
to make sure it doesn't overflow from results container. [Pull request #1710](https://github.com/INN/largo/pull/1710) for [issue #1509](https://github.com/INN/largo/issues/1509).
- Adds `largo_category_after_primary_featured_post` hook between primary and secondary featured posts on the `category.php` template. [Pull request #1703](https://github.com/INN/largo/pull/1703) by [@megabulk](https://github.com/megabulk).
- Adds `largo_series_before_stories` hook before stories on the `series-landing.php` template. [Pull request #1703](https://github.com/INN/largo/pull/1703) by [@megabulk](https://github.com/megabulk).
- Adds `largo_archive_before_stories` hook before stories on the `archive.php` template. [Pull request #1703](https://github.com/INN/largo/pull/1703) by [@megabulk](https://github.com/megabulk).

### Fixes and minor improvements

- Updates `largo_home_single_top` function to get `homepage_feature_term` and `top_story_term` values from slug instead of by name. If these prominence names were updated to anything else, `homepage_feature_term` and `top_story_term` would be false and fallback to `__('Homepage Featured', 'largo')`. [Pull request #1709](https://github.com/INN/largo/pull/1709) for [issue #1445](https://github.com/INN/largo/issues/1445).
- Removes separator `<span>` on search results page; puts the search result url on a new line instead of next to the date. Also adds a `overflow-wrap: breakword;` style to the search-result URL to make sure it doesn't overflow the result container. [Pull request #1710](https://github.com/INN/largo/pull/1710) for [issue #1509](https://github.com/INN/largo/issues/1509).

## [Largo 0.6.3](https://github.com/INN/largo/compare/v0.6.2...v0.6.3)

Expand Down
9 changes: 9 additions & 0 deletions docs/developers/hooksfilters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,19 @@ These actions are run on all homepage templates, including the Legacy Three Colu
**category.php**

- **largo_category_after_description_in_header** - between the ``div.archive-description`` and before ``get_template_part('partials/archive', 'category-related');``.
- **largo_category_after_primary_featured_post** - between the ``div.primary-featured-post`` and before the ``div.secondary-featured-post``.
- **largo_before_category_river** - just before the river of stories at the bottom of the category archive page (for adding a header to this column, for example)
- **largo_loop_after_post_x** - runs after every post, with arguments ``$counter`` and ``context`` describing which post it's running after and what the context is. (In categories, the context is ``archive``.)
- **largo_after_category_river** - immediately after the river of stories at the bottom of the category archive page, after the Load More Posts button (for adding a footer to this column, for example.)

**series-landing.php**

- **largo_series_before_stories** - at the top of the column of ``div.stories``.

**archive.php**

- **largo_archive_before_stories** - at the top of the column of ``div.stories``.

**search.php**

The Largo search page has two main modes: Google Custom Search Engine and the standard WordPress search emgine. Because the dispalyed layouts are so different, each has their own set of actions.
Expand Down
1 change: 1 addition & 0 deletions series-landing.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
?>

<div id="content" class="span<?php echo $content_span[ $opt['cftl_layout'] ]; ?> stories" role="main">
<?php do_action( 'largo_series_before_stories' ); ?>
<?php

global $wp_query, $post;
Expand Down

0 comments on commit 06cdb06

Please sign in to comment.