how can I query from any catagory?

How can I display posts query from any catagory?

for example, I want to show post two column layout.

first layout will be show one post with big thumbnail and title.

second layout will be show four posts with small thumbnail and title.

anybody can help me.

how can I query from any catagory?

Replay

You can run below query to get result of that specific category

//get result by category id here 4 given as category_id
$query = new WP_Query( array( 'cat' => 4 ) );
//or you can get result by category name here test given as category name
$query = new WP_Query( array( 'category_name' => 'test' ) );
//then run the wp loop
if ( $query->have_posts() ) :
    while ( $query->have_posts() ) : $query->the_post();
     //write your custom code here
    endwhile;
endif;

Category: post thumbnails Time: 2016-07-28 Views: 0

Related post

  • How can I query posts from any category? 2016-07-28

    How can I display posts query from any category? For example, I want to show post using two column layout. The first layout will show one post with big thumbnail and title. The second layout will show four posts with small thumbnail and title. ------

  • How eavesdropping will be performed how can I prevent from eavesdropping 2011-09-25

    I believe that eavesdropping in a man in middle attack and the message is passing from the client to server the man sitting at ISP or network hackers can look at what message I am sending. Heard that this can be easily done with wireless networks. We

  • How can I query posts with newly uploaded images? 2012-09-24

    I have a custom post type for events. A couple of days after each event photos are sometimes uploaded and attached to the event they were taken at. I want to highlight these image gallerys somewhere on my site, displaying them under a headline "Recen

  • Can anyone explain how can i query on ProfileApexClassAccess and ProfileApexPageAccess objects 2013-12-20

    Can anyone explain how can i query on ProfileApexClassAccess and ProfileApexPageAccess objects? --------------Solutions------------- This are not objects that can be queried using SOQL, they are actually part of the Profile data structure (ProfileApe

  • How can I tell from REST api which of an object's fields are required? 2014-03-20

    I am trying to create objects with the REST api, which works fine as long as I specify a value for each required field in the POST. The question is, how can I tell from the API which fields are required? According to the API documentation, I should u

  • How can I boot from a USB device via grub shell or initramfs? 2015-07-29

    I recently got my Dell XPS 13 with Ubuntu 14.04 preinstalled. After some time I tried to update Ubuntu (big mistake) just to find out that it doesn't work out of the box and there are some issues to solve. I didn't have the time to solve all the prob

  • How can I validate that any attachments file name does not have ANY special characters in JavaScript? 2015-10-01

    By default SharePoint does not allow the following special characters to be present in attachment file names ~, #, %, & , *, {, }, \, :, <, >, ?, /, |, " How can I validate that any attachments file name does not have ANY special characters

  • How can I query a USB device and know it is alive? 2015-11-18

    I'm using Raspbian on a Raspberry pi 2. I have an RFID reader connected to it via USB. My problem: The RFID USB device becomes unavailable at intermittent times and power cycling the device does not work. My question: How can I query the device and k

  • How can I query "Current Pending Service Routing Rate per Hour" limit of OmniChannel? 2015-12-03

    How can I query "Current Pending Service Routing Rate per Hour" limit of OmniChannel ? Or- any other way of getting this limit in apex class. Thanks More details about Omni Channel : https://help.salesforce.com/HTViewHelpDoc?id=service_presence_

  • How can I exit from my app? 2016-02-14

    How can I exit from my app? I want that when the user will clicked on the button, the app will exit completely, I saw any answers about it, but they took the app to backend, I want to exit completely --------------Solutions------------- in this metho

  • How can I boot from an external hard drive? 2009-12-10

    How can I boot from an external hard drive? hp --------------Solutions------------- You need to enter the BIOS of your computer and select USB as first boot device. Very often, the BIOS is entered by pressing a key at the very beginning of the boot s

  • How can I jump from the sidebar in Nautilus to the content area at right? 2011-05-20

    How can I jump from the sidebar in Nautilus to the content area at right? I want the keyboard focus to be inside the content area of the folder, so that I can start typing to initiate a search inside the folder. I'm using Fedora 15, Gnome3. ---------

  • How can I boot from Removable Disks? 2011-09-07

    I'm trying to get my computer to recognize my micro SD adapter as a removable disk. I've inserted it into my laptop and changed the BIOS settings to boot from "Removal Disks" or CD-ROM (I'm using an external CD-ROM) but nothing happens. The cont

  • How can I install from a 9.04 live USB/DVD? 2011-11-28

    I have a 9.04 (Jaunty) ISO burned to a USB stick; it appears to be a "live DVD". When I boot from it, I get a GRUB menu listing: Ubuntu, with Linux 2.6.35-generic (This matches the system currently installed on the HDD?) Ubuntu, with Linux 2.6.3

  • Printer share keeps asking for password and I can't authenticate from any machine. Why? 2012-05-07

    Ubuntu 12.04 printer share keeps asking for password and I can't authenticate from any machine. Why?? We've installed it in two machine (to act as printer servers) and we get the same problem. It doesn't matter what we do, change or install. We can't

  • How can I deny from a certain IP address but still show a custom error page with Apache2? 2012-11-01

    I have In my web root /home/www/ I have an .htaccess file to ban IP addresses: order allow,deny deny from 1.2.3.4 deny from 2.3.4.5 allow from all ErrorDocument 500 /errors/500.htm ErrorDocument 403 /errors/403.htm I have also tried it this way with

  • How can I buy from Software Center from my Mac computer? 2012-11-01

    I want to purchase software for my Ubuntu 12.04 (through Sofware Center) but now I can't use my Ubuntu computer (it's not at home), I'm only with my Mac, and the software I want to buy has a reduced price just until November 3... How can I buy from U

  • How can I query or view the usage and ownerships of physical memory? 2012-11-27

    On Windows 7 and Windows 2008 SP2, how can I view who or what is using up my memory? In the task manager I can see the memory usage of user processes of me and other users, but there's always a gap between the sum of the memory of the individual proc

  • How can I downgrade from Mountain Lion to Lion? 2013-01-11

    Possible Duplicate: How to revert to Lion from Mountain Lion? How can I downgrade from Mountain Lion to Lion ? I need to download Lion again... thanks --------------Solutions------------- I suggest you to do a complete backup with time machine, then

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 1.849 (s). 13 q(s)