jamoboggins
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Display custom field(s) as a drop-downI want to do exactly the same thing. Any help appreciated. It’s probably some custom php code that’s required I’d guess.
Forum: Fixing WordPress
In reply to: Using query posts to list child pagesRight, thanks to some incredible help from someone off the forum, this is now working as I want it to.
The key is to change
query_postsso that it queries pages instead of posts. The key line of code is:<?php query_posts('post_type=page&post_parent='.$parent); ?>I am slightly worried about the ‘Important Note’ on the query_posts code page, as I think this is creating a second loop with
query_postsbut so far it seems to be OK.Forum: Fixing WordPress
In reply to: Using query posts to list child pagesI’ve had some other advice, suggesting the following approach:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <?php $parent = $post->ID; ?> <h2><?php the_title(); ?></h2> <div class="entry"> <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> </div> <?php endwhile; endif; ?> <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> <?php query_posts('post_parent ='.$parent); ?> <ul> <?php while (have_posts()) : the_post(); ?> <li> <span class="headline"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span> <?php the_excerpt(); ?> </li> <?php endwhile; ?> </ul> </div>but the second loop calls up a post (the only post I have in my db) rather than the child pages. These are the functions that should call the child pages:
<?php $parent = $post->ID; ?>and
<?php query_posts('post_parent ='.$parent); ?>but at the moment these functions are calling a post instead of the child pages.
Forum: Fixing WordPress
In reply to: Using query posts to list child pagesThis is the latest code I’m using on the parent page (which has ID 5). I’m trying to list the children of the page the code appears on, and display the child page titles, and an excerpt from each child
<?php get_page_children( $page_id=5, $pages )?> <ul> <?php while (have_posts()) : the_post(); ?> <li> <span class="headline"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span> <?php the_excerpt(); ?> </li> <?php endwhile; ?> </ul>The page currently only displays the parent page title and excerpt (i.e. that’s what the loop is displaying), and seems to completely ignore
get_page_children. I basically want the loop to be used for a number of pages in the same way that it can be when displaying a number of posts on the same page. Is this even possible?Could it be that
get_page_childrenis already returning an array of objects and I need some more code to actually use them?I’m also unclear as to what ‘page objects’ it will return – is one object
the_contentand anotherthe_excerptetc? Or am I way off track?Sorry for my extreme lack of php knowledge, and thanks in advance for any help.
Forum: Fixing WordPress
In reply to: Using query posts to list child pagesThanks for replying, that sounds promising, but I’m afraid I’m a php beginner, and I’m not sure how to use get_page_children – how do I define the page_id as an integer and how do I define which page objects I want to call (I assumed I’d call things like the_content and the_excerpt in some following loops)?
If someone could write out the code that would let me simply list all children of the current page that’d be great and I’m sure I’ll get how to use the loops after that.
Forum: Plugins
In reply to: Coding error with version 2.5 with User Photo pluginI’m getting this as well. Looks like it’s not yet compatible with 2.5
Forum: Plugins
In reply to: Flash replacement fontsOK I’ve fixed it myself, though not completely sure how I did it.
The first thing I noticed was that in the original HTML there was something in the <head> tag relating to the javascript that runs the sFIR:
<script type="text/javascript" src="js/sifr.js"> </script> <script type="text/javascript" src="js/sifr-addons.js"></script>Because WordPress templates work by calling up various templates to create eage page, I needed to put this in the header.php template, not the custom homepage template I actually want the Flash replacement font to appear on. I also needed to change the file path so that src= wp-content/plugins/sifr, and also copied the additional javacript file ‘sifr-addons.js’ there (the FlashyTitles plugin doesn’t come with it).
I then deleted all of the computed html I’d put in (see above) and just left the <span> tag as it originally appeared:
<div class="column-head"> <h3><span>Upcoming festivals</span></h3> </div>I defined the font and colors within the the FlashyTitles interface in wp-admin. Then I named the CSS selector
.sIFR-hasFlash .column-head h3.That seemed to work, but to be sure what was happening I used Firebug to compare the output html from the local HTML/CSS build with my live WordPress site. It showed that the additional Flash arguments I added through the plugin interface were being duplicated. It seemed to pick up all the necessary CSS from the style-sheet, and directly with the sfir folder in /plugins rather than having it all defined through the plugin.
Note that all the filepaths lead to wp-content/plugins/sifr, and not wp-content/plugins/cg-flashytitles/sifr.
The only thing that’s different between the local build and the live WordPress version is that the image has rendered slightly darker, despite the same CSS colour code being used.
Hopefully this is useful for someone else trying to skin a WordPress theme from an HTML/CSS build.