equaldesign
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Query Child Pages of a Current Page and Loop Through Each Child PageGot it working with the following code:
<?php $this_page_id=$wp_query->post->ID; ?> <?php query_posts(array('showposts' => 20, 'post_parent' => $this_page_id, 'post_type' => 'page')); while (have_posts()) { the_post(); ?> <div class="subpage-img"> <?php if ( get_post_meta($post->ID, "post-img", true) ) { ?> <a href="<?php the_permalink(); ?>"><img class="subpage-customimg" src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "post-img", true); ?>&w=115&h=90&zc=1" alt="<?php the_title(); ?>" /></a> <h3><?php the_title(); ?></h3> <?php } else { ?> <p>This is a sub page of this one - <?php the_title(); ?></p> <?php } ?> <!-- closes subpage-img --> </div> <?php } ?>
So that gets all child pages of the current page, then loops through each child page , in this case showing a custom field in an image tag, using timthumb in order to auto resize the image.
Thanks for your help MichaelH.
Forum: Fixing WordPress
In reply to: Query Child Pages of a Current Page and Loop Through Each Child PageThanks for that info, however when I use this code it is telling me that the page_id is ‘0’ when it is clearly 3. Any ideas?
Forum: Fixing WordPress
In reply to: Hiding a page from navigation bar but not making it private?In your themes header.php file (probably without seeing your theme) you will find code similar to the following:
<?php wp_list_pages(title_li=&depth=1'); ?>
Add an include function to include only the page IDs that you want to show in the navbar, like this:
<?php wp_list_pages(title_li=&depth=1&include=1,2,3,4,5'); ?>
This will only include pages with IDs 1,2,3,4 and 5 in the navbar that lists your pages.Try looking here first
https://codex.www.ads-software.com/Creating_a_Static_Front_Page
Forum: Fixing WordPress
In reply to: remove text from menu, use images insteadTry adding the negative text indent to
#menu li a
Forum: Fixing WordPress
In reply to: Installed Plugins page does not load in wp-adminWhat error did you get?
Forum: Themes and Templates
In reply to: Weird Bullets show up in SidebarJust looked and the only bullet points I can see are the ones on the lists in the sidebar which appear normal to me?
Forum: Fixing WordPress
In reply to: remove text from menu, use images insteadFind which part of your CSS is styling the text. If this is a list of pages like a navbar then it will probably be some sort of list looking something like this in your css:
#navbar ul li
Add the following to it to send the text off the screen:
#navbar ul li { text-indent: -9999px; }
Forum: Fixing WordPress
In reply to: Help w/ Floating Background ImagesYes a link would be needed really in order to work out exactly where what you want to achieve.
Forum: Fixing WordPress
In reply to: How do I hide a page?Well usually all pages are display on a site using the wp_list_pages function, which is either in the sidebar or the heading.
If your theme is not using a widget then you can find where in your template files the wp_list_pages functions is used and then change it to this, replacing the number 1 with the ID of the page you want to exclude:
<?php wp_list_pages('exclude=1'); ?>
This means that there will then not be a link to the page on any of your websites pages however the page will still there at its own permalink URL.
If you use a widget to display you pages I think the widget has an exclusion facility built in.
Forum: Fixing WordPress
In reply to: Get Children and Loop Through Each ChildTypical! As soon as I post here I find the answer myself. Below does the above, but brings the title of each post rather than an image:
<?php query_posts(array('showposts' => 20, 'post_parent' => 7, 'post_type' => 'page')); while (have_posts()) { the_post(); ?> <h2><?php the_title(); ?></h2> <?php } ?>
Forum: Themes and Templates
In reply to: How to set up monthly and daily archivesIf you have resolved this then perhaps you could share the solution for others?
Forum: Fixing WordPress
In reply to: Loop inside sub categories loopThanks for that stvwlf it was almost as required, but thanks to that code I was able to adjust slightly to get what I required which is below:
<?php $descendants = get_categories(array('child_of' => 7)); ?> <?php foreach ($descendants as $child) { ?> <?php $catPosts = new WP_Query(); $catPosts->query("showposts=3&cat=$child->term_id"); ?> <h2><?php echo $child->cat_name; ?></h2> <?php while ($catPosts->have_posts()) : $catPosts->the_post(); ?> <ul> <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> </ul> <?php endwhile; ?> <?php } ?>
Forum: Themes and Templates
In reply to: header problem affecting the whole blogThis is a problem with your functions.php file. Try temporarily deleting the functions.php file and then checking if it works. Or revert to the default theme and then see if it fixes the problem. If so I’ll bet it is your functions.php file.
Everytime I have had this error it is the functions file in my theme.
Forum: Themes and Templates
In reply to: How to set up monthly and daily archivesTake a look here first:
https://codex.www.ads-software.com/Template_Tags/wp_get_archives