No Sticky Post in Featured Box

  • Author
    Posts
  • #116059
    myob9a
    Power User

    Kahuna Plus using a child theme.

    I am looking to use a Featured Box (3) on the Landing Page but don’t want a sticky post to show against a specific category. Is there a way to (script etc) to enable me to avoid the sticky post showing in the box?

    Website: dickson.org.au

    #116060
    myob9a
    Power User

    By the by – I tried the solution in https://www.cryoutcreations.eu/forums/t/offset-on-featured-posts only to have the functions.php advice of
    Uncaught Error: Call to undefined function cryout_localize_cat() in wp-content/themes/kahuna-plus-child/functions.php:34
    Stack trace:
    #0 wp-settings.php(528): include()
    #1 wp-config.php(106): require_once(‘/home/draorg/pu…’)
    #2 wp-load.php(37): require_once(‘/home/draorg/pu…’)
    #3 wp-admin/admin.php(34): require_once(‘/home/draorg/pu…’)
    #4 wp-admin/theme-editor.php(10): require_once(‘/home/draorg/pu…’)
    #5 {main}
    thrown

    Website: dickson.org.au

    #116284
    Zed
    Cryout Creations mastermind

    Hi,

    The example code is part of the theme and lists the default parameters of the function call retrieving the featured boxes content. To customize the content you’d need to write your own custom function that filters the necessary parameters (not copy that code as-is).

    Sticky posts are already ignored in the retrieval query, as dictated by the ignore_sticky_posts' => 1 parameter. However, this only excludes the sticky posts from being included at the beginning of the list – sticky posts are also regular posts and are included in the results according to their publish date.
    To exclude specific posts entirely, you’d need to make use of the post__not_in parameter by adding it using the filter.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘No Sticky Post in Featured Box’ is closed to new replies.