Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress Custom Fields from Sub-Page to Parent Page

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #24862
    slgworks
    Member

    Hello Everyone,

    I am new to wordpress theme design and php, so please excuse me if this is rudimentary.
    I am trying to setup a wordpress site that has a video archive page similar to the one on CSS-Tricks.
    I have individual video pages created as a sub-page of the video archive page.
    On the video archive page I have the individual video pages linked to dynamically using..

    Code:
    ID.’&echo=0′);
    if ($children) { ?>

    Also on the individual video pages, I have a custom field setup called "thumb" that I place the URL of the post thumbnail in.
    I would like to access the custom field info from the parent video page and have the image display in the list item of the dynamically generated links.

    In other words I would like to dynamically load all the images from the sub-page custom field on parent page.

    I hope that this makes sense.

    Any help is much appreciated.

    #57631
    AshtonSanders
    Participant

    Hi,

    As far as I know, you can only echo the meta data from inside "the_loop"

    This page has more info about Meta Data http://codex.wordpress.org/Using_Custom_Fields

    #57821
    Chris Coyier
    Keymaster

    Yeah that sounds about right. Perhaps you should do a well-executed query_posts() to get those child pages, so then you are inside the loop and have access to the page titles AND can grab that image that is a custom field.

    #57929

    If you only need a flat list of posts under the current page then simply using query_posts with a loop would be your best option. The only problem is if you have hierarchical pages, which would require nested lists, as that is a little more complicated to acheive and it is this that most of the magic inside wp_list_pages is dedicated to.

    I think you could use the following (untested) code as a starting point:

    Code:
    query_posts(“post_type=page&post_status=publish&post_parent=$post->ID&orderby=title&order=asc&showposts=-1”);
    if (have_posts()) : while(have_posts()) : the_post();

    echo ‘

  • ‘ . ‘ID) . ‘” title=”‘ . attribute_escape(apply_filters(‘the_title’, $post->post_title)) . ‘”>’ . ‘
  • ‘;

    endwhile; endif;

#58248
juliaxyz
Member

How do they do this magic trick? You know that magic trick were a woman walks behind lets say a piece of wood that a guy is holding, she stands behind it for like 2 seconds and then shes wering different clothes to the one before she went behind the piece of wood. Could you please help me?
____________________
yahoo keyword tool ~ overture ~ traffic estimator ~ adwords traffic estimator

#58250
davesgonebananas
Member

It’s all done with smoke and mirrors.

#58285
AshtonSanders
Participant

for some reason, I always subconsciously add "bananas" to the first line of every one of your posts…

Code:
It’s all done with smoke, bananas and mirrors.

oh…. wait a minute… :lol:

#58306
davesgonebananas
Member

smokey bananas… mmm delicious

Viewing 8 posts - 1 through 8 (of 8 total)