is there a way i can alter a wordpress theme to display posts from 2 different categories instead of the one that can be set in banner settingGet Wordpress Category from Single PostWordpress Foreach, Pass Category ID variable to Display Posts?Get Posts Based on Category WordpressWordPress WP_Query: Display custom post type based on custom meta value, and also order on another custom meta valueWordpress - Different 'posts-per-page' for paginated pagesWordPress: How to filter posts by category using $wp_query?Wordpress theme - display posts marked as 2 categoriesWordpress: Using post__not_in to exclude custom taxonomy categoryShow Parent Category instead of First Category - WordpressBootstrap carasoul Indicator doesnot work

Multi tool use
Binary Numbers Magic Trick
Was there a Viking Exchange as well as a Columbian one?
What does KSP mean?
Who is the Umpire in this picture?
What happened to Captain America in Endgame?
Realistic Necromancy?
Please, smoke with good manners
How come there are so many candidates for the 2020 Democratic party presidential nomination?
With a Canadian student visa, can I spend a night at Vancouver before continuing to Toronto?
Critique of timeline aesthetic
What language was spoken in East Asia before Proto-Turkic?
Will tsunami waves travel forever if there was no land?
How to solve constants out of the internal energy equation?
What is the strongest case that can be made in favour of the UK regaining some control over fishing policy after Brexit?
US visa is under administrative processing, I need the passport back ASAP
Checks user level and limit the data before saving it to mongoDB
Does this extra sentence in the description of the warlock's Eyes of the Rune Keeper eldritch invocation appear in any official reference?
What do the phrase "Reeyan's seacrest" and the word "fraggle" mean in a sketch?
Uniformly continuous derivative implies existence of limit
a sore throat vs a strep throat vs strep throat
Why does nature favour the Laplacian?
Which big number is bigger?
How much cash can I safely carry into the USA and avoid civil forfeiture?
The Defining Moment
is there a way i can alter a wordpress theme to display posts from 2 different categories instead of the one that can be set in banner setting
Get Wordpress Category from Single PostWordpress Foreach, Pass Category ID variable to Display Posts?Get Posts Based on Category WordpressWordPress WP_Query: Display custom post type based on custom meta value, and also order on another custom meta valueWordpress - Different 'posts-per-page' for paginated pagesWordPress: How to filter posts by category using $wp_query?Wordpress theme - display posts marked as 2 categoriesWordpress: Using post__not_in to exclude custom taxonomy categoryShow Parent Category instead of First Category - WordpressBootstrap carasoul Indicator doesnot work
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
The themes banner settings allow it to show posts of one category.
But i would like it to show posts of two different categories
Here is what i tried
if ( $newscard_settings['newscard_banner_featured_posts_1_hide'] === 0 ) {
$newscard_fp_1_cat = absint($newscard_settings['newscard_banner_featured_posts_1_post_categories']);
$post_type_fp_1 = array(
'posts_per_page' => 2,
'post__not_in' => get_option('sticky_posts'),
'post_type' => array(
'post'
),
);
if ( $newscard_settings['newscard_banner_featured_posts_1_latest_post'] == 'category' )
$post_type_fp_1 = array( 'category__and' => array(8,15), 'posts_per_page' => 2, 'orderby' => 'title', 'order' => 'DESC' );
$newscard_get_featured_post_1 = new WP_Query($post_type_fp_1);
But it does not display any thing.
Here is the original code
if ( $newscard_settings['newscard_banner_featured_posts_1_hide'] === 0 ) {
$newscard_fp_1_cat = absint($newscard_settings['newscard_banner_featured_posts_1_post_categories']);
$post_type_fp_1 = array(
'posts_per_page' => 2,
'post__not_in' => get_option('sticky_posts'),
'post_type' => array(
'post'
),
);
if ( $newscard_settings['newscard_banner_featured_posts_1_latest_post'] == 'category' )
$post_type_fp_1['category__in'] = $newscard_fp_1_cat;
$newscard_get_featured_post_1 = new WP_Query($post_type_fp_1);
php wordpress wordpress-theming
add a comment |
The themes banner settings allow it to show posts of one category.
But i would like it to show posts of two different categories
Here is what i tried
if ( $newscard_settings['newscard_banner_featured_posts_1_hide'] === 0 ) {
$newscard_fp_1_cat = absint($newscard_settings['newscard_banner_featured_posts_1_post_categories']);
$post_type_fp_1 = array(
'posts_per_page' => 2,
'post__not_in' => get_option('sticky_posts'),
'post_type' => array(
'post'
),
);
if ( $newscard_settings['newscard_banner_featured_posts_1_latest_post'] == 'category' )
$post_type_fp_1 = array( 'category__and' => array(8,15), 'posts_per_page' => 2, 'orderby' => 'title', 'order' => 'DESC' );
$newscard_get_featured_post_1 = new WP_Query($post_type_fp_1);
But it does not display any thing.
Here is the original code
if ( $newscard_settings['newscard_banner_featured_posts_1_hide'] === 0 ) {
$newscard_fp_1_cat = absint($newscard_settings['newscard_banner_featured_posts_1_post_categories']);
$post_type_fp_1 = array(
'posts_per_page' => 2,
'post__not_in' => get_option('sticky_posts'),
'post_type' => array(
'post'
),
);
if ( $newscard_settings['newscard_banner_featured_posts_1_latest_post'] == 'category' )
$post_type_fp_1['category__in'] = $newscard_fp_1_cat;
$newscard_get_featured_post_1 = new WP_Query($post_type_fp_1);
php wordpress wordpress-theming
using category_and means it has to be in both categories could that be the problem? You may want $post_type_fp_1['category__in'] = array(8,15);
– Willy Richardson
Mar 22 at 19:45
Thanks Willy, That works
– rkay
Mar 23 at 16:19
add a comment |
The themes banner settings allow it to show posts of one category.
But i would like it to show posts of two different categories
Here is what i tried
if ( $newscard_settings['newscard_banner_featured_posts_1_hide'] === 0 ) {
$newscard_fp_1_cat = absint($newscard_settings['newscard_banner_featured_posts_1_post_categories']);
$post_type_fp_1 = array(
'posts_per_page' => 2,
'post__not_in' => get_option('sticky_posts'),
'post_type' => array(
'post'
),
);
if ( $newscard_settings['newscard_banner_featured_posts_1_latest_post'] == 'category' )
$post_type_fp_1 = array( 'category__and' => array(8,15), 'posts_per_page' => 2, 'orderby' => 'title', 'order' => 'DESC' );
$newscard_get_featured_post_1 = new WP_Query($post_type_fp_1);
But it does not display any thing.
Here is the original code
if ( $newscard_settings['newscard_banner_featured_posts_1_hide'] === 0 ) {
$newscard_fp_1_cat = absint($newscard_settings['newscard_banner_featured_posts_1_post_categories']);
$post_type_fp_1 = array(
'posts_per_page' => 2,
'post__not_in' => get_option('sticky_posts'),
'post_type' => array(
'post'
),
);
if ( $newscard_settings['newscard_banner_featured_posts_1_latest_post'] == 'category' )
$post_type_fp_1['category__in'] = $newscard_fp_1_cat;
$newscard_get_featured_post_1 = new WP_Query($post_type_fp_1);
php wordpress wordpress-theming
The themes banner settings allow it to show posts of one category.
But i would like it to show posts of two different categories
Here is what i tried
if ( $newscard_settings['newscard_banner_featured_posts_1_hide'] === 0 ) {
$newscard_fp_1_cat = absint($newscard_settings['newscard_banner_featured_posts_1_post_categories']);
$post_type_fp_1 = array(
'posts_per_page' => 2,
'post__not_in' => get_option('sticky_posts'),
'post_type' => array(
'post'
),
);
if ( $newscard_settings['newscard_banner_featured_posts_1_latest_post'] == 'category' )
$post_type_fp_1 = array( 'category__and' => array(8,15), 'posts_per_page' => 2, 'orderby' => 'title', 'order' => 'DESC' );
$newscard_get_featured_post_1 = new WP_Query($post_type_fp_1);
But it does not display any thing.
Here is the original code
if ( $newscard_settings['newscard_banner_featured_posts_1_hide'] === 0 ) {
$newscard_fp_1_cat = absint($newscard_settings['newscard_banner_featured_posts_1_post_categories']);
$post_type_fp_1 = array(
'posts_per_page' => 2,
'post__not_in' => get_option('sticky_posts'),
'post_type' => array(
'post'
),
);
if ( $newscard_settings['newscard_banner_featured_posts_1_latest_post'] == 'category' )
$post_type_fp_1['category__in'] = $newscard_fp_1_cat;
$newscard_get_featured_post_1 = new WP_Query($post_type_fp_1);
php wordpress wordpress-theming
php wordpress wordpress-theming
edited Mar 22 at 18:56


Dave
2,97081830
2,97081830
asked Mar 22 at 18:39
rkayrkay
32
32
using category_and means it has to be in both categories could that be the problem? You may want $post_type_fp_1['category__in'] = array(8,15);
– Willy Richardson
Mar 22 at 19:45
Thanks Willy, That works
– rkay
Mar 23 at 16:19
add a comment |
using category_and means it has to be in both categories could that be the problem? You may want $post_type_fp_1['category__in'] = array(8,15);
– Willy Richardson
Mar 22 at 19:45
Thanks Willy, That works
– rkay
Mar 23 at 16:19
using category_and means it has to be in both categories could that be the problem? You may want $post_type_fp_1['category__in'] = array(8,15);
– Willy Richardson
Mar 22 at 19:45
using category_and means it has to be in both categories could that be the problem? You may want $post_type_fp_1['category__in'] = array(8,15);
– Willy Richardson
Mar 22 at 19:45
Thanks Willy, That works
– rkay
Mar 23 at 16:19
Thanks Willy, That works
– rkay
Mar 23 at 16:19
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55305946%2fis-there-a-way-i-can-alter-a-wordpress-theme-to-display-posts-from-2-different-c%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55305946%2fis-there-a-way-i-can-alter-a-wordpress-theme-to-display-posts-from-2-different-c%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
7LV8,a,4zp3yAd5K,XGazyXuDi9kyte
using category_and means it has to be in both categories could that be the problem? You may want $post_type_fp_1['category__in'] = array(8,15);
– Willy Richardson
Mar 22 at 19:45
Thanks Willy, That works
– rkay
Mar 23 at 16:19