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

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;








0















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);









share|improve this question
























  • 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

















0















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);









share|improve this question
























  • 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













0












0








0








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);









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript