Recently, I needed to list all subpages of a parent page. I also needed to display custom fields below each subpage. And, on top of that, the list needed to be 2 columns.
I found a solution for simply listing the pages in 2 columns, but it did not suggest how to modify the code to include custom fields.
So, thanks to our coding hero Mark Kaplun who supplied the below code, although he admits it’s a “dirty hack”. The sort_column is so that MyPageOrder would work properly for this listing.
<?php
$args = array(
‘post_type’ => ‘page’,
‘numberposts’ => 40,
‘sort_column’ => ‘menu_order’,
‘child_of’ => 84 // any parent
);
$attachments = get_pages($args);
//print_r(“attachements:” . $attachements);
echo ‘<div style=”float: left; margin: 0 10px 0 0;”>’;
?>
<?php
for ($i =0; $i<count($attachments)/2; $i++) {
$post = $attachments[$i];
// foreach ($attachments as $post) { ?>
<a href=”<?php echo get_permalink($post->ID) ?>” rel=”bookmark”><?php…
331 readersEasily put your post's content into columns using just the WordPress text editor and a CSS grid.
389 readersWe’re currently building a site on Adii’s Premium Gazette WordPress theme (this is an affiliate link). In my opinion, it’s an awesome theme particularly because of the design. However, we installed it on the client’s server of choice, and the posts on the homepage just wouldn’t update. We tested ...
1587 readersWe were working on a WordPress site that needed to display a sticky post at the top of the blog page with one style, and then below it a list of the most recent posts with a completely different style. I realize that you can just style the sticky post using the sticky-related classes provided
1423 readersJust a very quick tip but nonetheless an important one. Many of you will be using any number of plugins or the database query that's been doing the rounds recently to display your most popular posts. That code/plugin is no longer needed as WordPress' query_posts can now display your most commented posts.You really should be
1912 readersWe recently launched a site called theforgottenletters.org, an incredible project dedicated to translating the Holocaust-era letters of Ralph Schwab from German to English. While building the site, we needed to archive the letters based on the dates the letters were written, not when we publish them to the site. First, I tried this tutorial: How
299 readersI was asked by a reader: I’m using the THiCK theme for my new design blog. I noticed you were able to add thumbnail images above your blog posts on the home page. What would I need to do to enable this on my blog? Well Jon, this can be done very simple, since the theme is
243 readersOne of ten brilliant tips that I shared yesterday on my blog – display images on your blog’s homepage without any custom fields or any additional functions.php script, something I first saw on WebDeveloperPlus. How do you do it? First log in, on the sidebar select ‘Media’ (which is under ‘Settings’). You’ll then be taken
364 readersOne part of WordPress that I've never been overly impressed with is archives. This isn't so much a WordPress problem as it an archive problem, archives are inherently boring. As a result of this revelation I've spent some time thinking up new ways to present the information. My latest idea was adding charts to represent
328 readersIf you have a Google Analytics account, you must have seen that Google uses slightly rounded edges in the menu buttons on the left. See the picture below :- Today, I will teach you how to give these nifty little rounded edges to your menu. Given below is the CSS code. This goes into the
1639 readersI’m all about tinkering with different ideas to display posts with WordPress. After all, it’s just a bunch of data at our fingertips! WordPress makes it easy to output whatever we need. Not long ago we experimented with making a Thumbnail Based Archives. Now let’s build a Randomized Grid Archives. 1. Create a page template,
4,618
Curious what others are searching for? Below are the most popular search terms over the last 30 days.

