Skip to content

Instantly share code, notes, and snippets.

@ernilambar
Created August 27, 2014 00:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ernilambar/ad31b89b459e954fc950 to your computer and use it in GitHub Desktop.
Save ernilambar/ad31b89b459e954fc950 to your computer and use it in GitHub Desktop.
Example Page Template for showing featured posts [NS Featured Posts]
@pixelpuur
Copy link

man how can i see the posts that are not featured with the upper code of featured.php

@pixelpuur
Copy link

pixelpuur commented Oct 4, 2017

Making one page template with two section

Upper section show feat post

section below show the non feat posts

cant get it working

[code]

'bedrijf', 'meta_key' => '_is_ns_featured_post', 'meta_value' => 'yes', ); // Get current page and append to custom query parameters array $custom_query_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;

$custom_query = new WP_Query( $custom_query_args ); ?>

Featured

have_posts() ) : ?> have_posts() ) : $custom_query->the_post(); ?> max_num_pages ); ?>

'bedrijf', 'meta_key' => '_is_ns_featured_post', 'meta_value' => 'yes', ); // Get current page and append to custom query parameters array $custom_query_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;

$custom_query = new WP_Query( $custom_query_args ); ?>

Niet Featured

have_posts() ) : ?> have_posts() ) : $custom_query->the_post(); ?> max_num_pages ); ?>

get_footer();
?>

[/code]

now both shop feat posts any suggestions?

@amitsarkerr
Copy link

I can show the featured posts by using <?php $query = new WP_Query( array( 'meta_key' => '_is_ns_featured_post', 'meta_value' => 'yes' ) );?>
I want to not show the featured posts. How I can hide the featured posts in all the posts ?

@wpfangirl
Copy link

wpfangirl commented Dec 28, 2017

@amitsarker89 Try changing the args so that 'meta_value' => 'no'

@kivisic
Copy link

kivisic commented Oct 3, 2019

how to show featured but per category? Not list all featured post, then just featured per post category? Suggestion of code pls? Tnx.

@rjiansevilla
Copy link

Hi I am a newbie to this plugin. Can someone teach me how to make this as a schortcode? So that I can apply any page etc. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment