Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Custom php in a page


 
Prev Previous Post   Next Post Next
  #1  
Old Apr 4, 2010, 02:59 PM
ccw
 
8 posts · Apr 2009
Custom php in a page

The site that I am working on is:

http://www.thewrightrecipes.com

I'm trying to build a "Recipe Index" page. I started by installing the AZIndex plugin and thought that this would work great. I could create a custom field with the recipe title (seldom the same as the post title) and sort by Category/custom field. Unfortunately, there is often more than 1 recipe per post. While I could add numerous custom fields to each post with the same key, AZIndex will only return 1 value per post.
Id like to build an index page making use of php code to return custom field values. I think that I could hack my way through it if I even knew where to begin. How do you create pages using custom php code like this:

<ul>
<?php
$sweets = get_posts('category=7&numberposts=-1&orderby=post_name&order=ASC');
foreach($sweets as $post) : setup_postdata($post);
?>
<li>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
<?php $sweets = get_post_meta($post->ID, "sweets", $single = true);
if($sweets !== '') {
echo 'by ' . $sweets;
} ?>
</li>
<?php endforeach; ?>
</ul>

Where does that go? Is this too basic of a question? Any help would be appreciated.

Thanks
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pls help me change this code<title><?php bloginfo('name'); ?><?php wp_title(); ?></ti tobywinn Header configuration & styling 1 Nov 18, 2011 11:51 AM
[SOLVED] Hide left sidebar on just one custom php page that isn't in the options list marced Sidebars & Widgets 13 Mar 2, 2010 01:35 PM
[SOLVED] Custom header.php &amp; css: logo doesn't show dougc Header configuration & styling 4 Feb 1, 2010 11:00 AM
Add custom php/js menu below header dmtompki Header configuration & styling 6 Jun 23, 2009 10:03 AM
make index.php be a "page" and blog postings go to different php page zhidoni Atahualpa 3 Wordpress theme 0 Jun 21, 2009 04:25 PM


All times are GMT -6. The time now is 12:00 AM.


Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.