Articles of loop

How to show subcategories using loop?

i am using wp_list_categories(‘child_of=54&title_li=’) method to display all the subcategories, but it is showing only one, how can i use it with loop to show all the subcategories properly.

How to Fix an Archive.php That Displays All Posts?

I am currently working on developing my first large-scale WordPress powered site, and I have run into a major problem in my archive.php file. It loads all posts, rather than the categories/tags that I am looking to display. The basic idea is to have an article-showcase bar in which the first 6 posts will be […]

Loop Post Types with Name and Links

I’m trying to create a menu which loops through the registered custom post types and links to their archive pages. I’ve been able to get the list of post type names but it is not generating the links. It only outputs a en empty anchor tag wrapped around the post types name. $args = array( […]

Blank content php code not parsing advanced custom fields gallery add-on

I have blank contents where the content for the act gallery code is. I think there is an issue with the code. < ?php /* Template Name: Images scroll */ ?> <?php get_header(); ?> <div id=”wrapper” class=”wrapper-scroll”> <div class=”content”> <?php if (is_page_template( ‘index.php’ ) ) { if (is_page( ‘home’ )) { $jennifergallery=’gallery_home’; }; if (is_page( […]

How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()

What is the best practice methodology for referencing the main loop from within the context of a secondary loop within a partial called via get_template_part()? For example, say my homepage contains a secondary loop to list two posts of type article: <?php $articles = new WP_Query( array( ‘post_type’ => ‘article’, ‘posts_per_page’ => 2 ) ); […]

Problem with Front-Page.php loading recent posts

Hi I this weird problem where i have my custom front-page.php with set page (in Reading Settings) static page. What I want to have is a static page with welcoming message and later 1 recent posts from post-type and 4 recent posts form custom post type. To get static page info I use: <?php while […]

Altering “posts_per_page” for defaut loop

I am trying to alter posts_per_page value in default wordpress loop on-the-fly, not for a custom loop. global $wp_query ; // $wp_query->query_vars[‘posts_per_page’] = 1000 ; $wp_query->set(‘posts_per_page’,1000) ; while ($wp_query->have_posts()) { $wp_query->the_post() ; // other operations } How to do that?

Three Column Loop

I have a theme that creates two columns of categories with child posts from that category. I’ve tried messing with the code that inserts the after two posts are listed, but it’s not working (because I don’t know what I’m doing). The current php renders as follows: <div class=”row”> <div class=”column col-half”>…</div> <div class=”column col-half”>…</div> […]

Display page of custom posts?

I have a custom post type, “design_asset”. I am displaying them on a page template, with the loop <?php rewind_posts(); $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var(‘paged’) : 1; $args = array( ‘post_type’ => ‘design_asset’, ‘posts_per_page’ => 100, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’ ); $loop = new WP_Query( $args ); while ( […]

foreach loop inside the loop creating duplicates in output

I have a foreach loop inside the loop that is getting info from a separate table. The table has a column that has an id that reflects the id of the post type so it should always be unique. When I look at the results, the created variable ($fullname) is displayed multiple times in rows […]