Largo Project
v0.6.4
  • For Developers
  • Feedback on these docs
  • Support
  • Function reference by file
    • archive.php
    • feed-mailchimp.php
    • functions.php
    • homepages/homepage.php
    • homepages/layouts/HomepageSingleWithSeriesStories.php
    • homepages/zones/zones.php
    • inc/ajax-functions.php
    • inc/avatars.php
    • inc/avatars/functions.php
    • inc/byline_class.php
    • inc/conditionals.php
    • inc/custom-feeds.php
    • inc/custom-less-variables.php
    • inc/customizer/customizer.php
    • inc/dashboard.php
    • inc/deprecated.php
    • inc/editor.php
    • inc/enqueue.php
    • inc/featured-content.php
    • inc/featured-media.php
    • inc/gutenberg-block-edits.php
    • inc/header-footer.php
    • inc/helpers.php
    • inc/images.php
    • inc/metabox-api.php
    • inc/nav-menus.php
    • inc/open-graph.php
    • inc/post-metaboxes.php
    • inc/post-social.php
    • inc/post-tags.php
    • inc/post-templates.php
    • inc/related-content.php
    • inc/sidebars.php
    • inc/taxonomies.php
    • inc/term-icons.php
    • inc/term-meta.php
    • inc/term-sidebars.php
    • inc/update.php
    • inc/users.php
    • inc/verify.php
    • inc/widgets.php
    • inc/widgets/largo-about.php
    • inc/widgets/largo-author-bio.php
    • inc/widgets/largo-facebook.php
    • inc/widgets/largo-image-widget.php
    • inc/widgets/largo-post-series-links.php
    • inc/widgets/largo-recent-comments.php
    • inc/widgets/largo-recent-posts.php
    • inc/widgets/largo-taxonomy-list.php
    • inc/widgets/largo-twitter.php
    • inc/wp-taxonomy-landing/functions/cftl-admin.php
    • inc/wp-taxonomy-landing/functions/cftl-series-order.php
    • options.php
Largo Project
  • Docs »
  • For Developers »
  • Function reference by file »
  • inc/featured-content.php
  • Edit on GitHub

inc/featured-content.php¶

largo_get_featured_posts()¶

Shorthand for querying posts from a custom taxonomy Used in homepage templates and sidebar widgets

Parameters:
  • $args (array) – query args
Returns:

array $f featured post objects

Since:

0.3

largo_get_the_main_feature()¶

Provides the “main” feature associated with a post. Expects to be called from within The Loop.

Uses:global $post
Returns:term $bject|false
Since:0.3
largo_scrub_sticky_posts()¶

If a post is marked as sticky, this unsticks any other posts on the blog so that we only have one sticky post at a time.

If this ever breaks, #blamenacin.

Parameters:
  • $after (array) – new list of sticky posts
  • $before (array) – original list of sticky posts
Returns:

array

Since:

1.0

largo_have_featured_posts()¶

Determine if we have any ‘featured’ posts on archive pages

largo_have_homepage_featured_posts()¶

Determine if we have any ‘featured’ posts on homepage

largo_get_featured_posts_in_category()¶

Get posts marked as “Featured in category” for a given category name.

Parameters:
  • $category_name (string) – the category to retrieve featured posts for.
  • $number (integer) – total number of posts to return, backfilling with regular posts as necessary.
Since:

0.5

largo_category_archive_posts()¶

Helper for getting posts in a category archive, excluding featured posts.

Parameters:
  • $query (WP_Query) –
Uses:

largo_get_featured_posts_in_category

Since:

0.4

Next Previous

© Copyright 2019, Institute for Nonprofit News Revision c41d8519.

Built with Sphinx using a theme provided by Read the Docs.