Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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.
I’d 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:52 PM.


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