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








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







7LV8,a,4zp3yAd5K,XGazyXuDi9kyte
4IwU1ss3NGMDqYa6B3JN8AEPaEHo1sZkw6

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

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

위키백과:대문 둘러보기 메뉴기부 안내모바일판 대문크리에이티브 커먼즈 저작자표시-동일조건변경허락 3.0CebuanoDeutschEnglishEspañolFrançaisItaliano日本語NederlandsPolskiPortuguêsРусскийSvenskaTiếng ViệtWinaray中文العربيةCatalàفارسیSrpskiУкраїнськаБългарскиНохчийнČeštinaDanskEsperantoEuskaraSuomiעבריתMagyarՀայերենBahasa IndonesiaҚазақшаBaso MinangkabauBahasa MelayuBân-lâm-gúNorskRomânăSrpskohrvatskiSlovenčinaTürkçe