Forum Replies Created

Viewing 13 replies - 91 through 103 (of 103 total)
  • Thread Starter downfast

    (@downfast)

    yes they are pages.
    Custom field? This is interesting; i have just used custom fields for another project, I dind’t know i could use them to generate css for menu links as well; how would u do that?

    Thread Starter downfast

    (@downfast)

    done..

    <?php
    
    $args = array(
    	'post_type' => 'attachment',
    	'post_parent' => $page->ID,
    	'numberposts' => 1,
    	);
    $attachments = get_posts($args);
    if ($attachments) {
    	foreach ($attachments as $attachment) {
    		echo the_attachment_link($attachment->ID, false);
    	}
    }
    
    ?>

    Thread Starter downfast

    (@downfast)

    any one please?

    Thread Starter downfast

    (@downfast)

    err yeah..thanks
    I am using a plugin which works just fine; all i need to do is to be able to run it via the loop i am using to diplay the other information e.g the meta

    basically something like:

    <?php $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc&parent='.$post->ID); foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; ?>
    	<li cass="thumbList" >
    		<a>ID) ?>" class="clearfix" ><h1 class="title"> <?php echo $page->post_title ?> </h1>
    <?php get_the_image(); ?>
    		<?php $key_1_value = get_post_meta($page->ID, 'Preview', true);
    		print $key_1_value; ?></a>
    
    <?php }

    Any idea?

    Thread Starter downfast

    (@downfast)

    I have found a solution and it works perfectly but i would like to understand why it only displays the image and not the text, it is actually what i wanted, but why does it do this?

    this is the code i am using now:

    <ul class="thumb">
    
    <?php $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc&parent='.$post->ID); $count = 0; foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; $count++; ?>
    <li cass="thumbList" >
    	<a href="<?php echo get_page_link($page->ID) ?>"><h1 class="title"> <?php echo $page->post_title ?> </h1>
    	<?php echo apply_filters('the_content', $post->post_content); ?>
    
    <?php $key_1_value = get_post_meta($page->ID, 'Preview', true);
    print $key_1_value; ?>
    </a>
    
    </li>
    
    <?php
        }
    ?>
    
    </ul>

    Thread Starter downfast

    (@downfast)

    that’s it! that is exactly what I was looking for.
    yes it had more custom fields, but i wanted to only target one of them, basically i am building a page with thumbs of the sub pages and i needed to get part on the info in each thumb.

    Anyway..thanks a lot! ??

    Thread Starter downfast

    (@downfast)

    hey thanks a lot, i think it’s getting closer but not quite there yet..

    it is now getting the “low season” which is the name of my custom field, but also displaying other info..

    Low season : Array
    _edit_lock : Array
    _edit_last : Array
    mf_page_type : Array
    _wp_page_template : Array
    _cspc-page-transitions : Array

    Thread Starter downfast

    (@downfast)

    thanks but i get this:

    Warning: Invalid argument supplied for foreach() in C:\wamp\www\mandc\wp-content\themes\mandc\thumb.php on line 24

    where line 24 is where i have inserted that code (just before the closing div).. any idea?

    Thread Starter downfast

    (@downfast)

    whoops…forgot to add the code tags

    <?php $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc&parent='.$post->ID); $count = 0; foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; if($count >= 2) break; $count++; ?>
    
    <div class="thumb">
    ID) ?>"><h1 class="title"> <?php echo $page->post_title ?> </h1>
    <?php echo $page->post_content ?>
    </div>
    Thread Starter downfast

    (@downfast)

    the solution i have taken was to set display:none in the first sub ul it creates within the main page sul; this si fine as now it only shows the ul i want, but it is not accesible not a good mark up

    Thread Starter downfast

    (@downfast)

    i have tried them. but what they do is create a duplicate of the sub pages, one in the the main pages ul and another below. Basicaly they duplicate the sub pages into 2 different position.

    What happens is the when i try each of the codes given as an example, it echoes to me teice the sub pages, one in the main menu and one in another div.

    <ul class=”menu”>

    <?php if (function_exists(‘wswwpx_fold_page_list’)) : ?>

    <?php wswwpx_fold_page_list(‘sort_column=menu_order&title_li=’); ?>

    <?php else : ?>

    <?php wp_list_pages(); ?>

    <?php endif; ?>

    <?php echo $children; ?>

    </div>

    this will give me a list of the main menu with a sub menu displayed below the main page which has a sub page..but below the ul it will repeat the sub page once again for some reason; i did try all the solution there; it just seem to repreat the sub page echo for some reason.. i need to be able to place the WHATEVER SECOND ( OR IN FUTRE THIRD) below the main ul

    Thread Starter downfast

    (@downfast)

    thank you

    idially i would like to only add : <?php echo $children; ?>

    but

    this is my mark up:

    <ul class=”menu”>

    <?php if (function_exists(‘wswwpx_fold_page_list’)) : ?>

    <?php wswwpx_fold_page_list(‘sort_column=menu_order&title_li=’); ?>

    <?php else : ?>

    <?php wp_list_pages(); ?>

    <?php endif; ?>

    <?php echo $children; ?>

    the sub pages e.g. <?php echo $children; ?>

    come up to be within the ul of the main pages even tho i put it put site the main ul tag; basically i need to have the sub page display in another diver below the main one with a scroll bar

    any help please?

Viewing 13 replies - 91 through 103 (of 103 total)