Linosa
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to check if custom field from Types plugin existIt works perfect. Thank you very much!!!
Forum: Fixing WordPress
In reply to: Include sticky post in loopOk, so I changed my theme to twenty thirteen and then it works like I want it to. Then I guess there’s something with twenty fifthteen who does it. Any ideas what?
Forum: Fixing WordPress
In reply to: Include sticky post in loopI have a sticky post and haven’t changed anything as fas as I know ??
Forum: Fixing WordPress
In reply to: Show the content insted of title in a list.It worked! Thank you very much!
Forum: Fixing WordPress
In reply to: Loop child pages displaying different content depending on depthOk, so I found this code and it ALMOST does the job.
<?php $portfolioID = $post->ID; $portfolio_sections = array( 'post_type' => 'page', 'child_of' => $portfolioID, 'sort_column' => 'menu_order', 'sort_order' => 'ASC', ); $sections = get_pages($portfolio_sections); $hierachical = array(); if ( ! empty($sections) ) { foreach ( $sections as $section ) { if ( $section->post_parent == $portfolioID ) { if ( ! isset( $hierachical[$section->ID]) ) $hierachical[$section->ID] = array(); $hierachical[$section->ID]['child'] = $section; $hierachical[$section->ID]['grandchildes'] = array(); } else { if ( ! isset( $hierachical[$section->post_parent]) ) $hierachical[$section->post_parent] = array(); $hierachical[$section->post_parent]['grandchildes'][] = $section; } } foreach ( $hierachical as $id => $hierachical_data ) { if ( ! isset($hierachical_data['child']) || ! is_object($hierachical_data['child']) ) continue; echo '<div class="grid">'; echo '<h2>' . get_the_title($hierachical_data['child']->ID) . '</h2>'; echo '<ul>'; if ( isset($hierachical_data['grandchildes']) && ! empty($hierachical_data['grandchildes']) ) { foreach ( $hierachical_data['grandchildes'] as $grandchild ) { if ( ($grandchild->ID)) { echo '<li>'; echo get_the_title($grandchild->ID); echo '</li>'; } } } echo '</ul>'; echo '</div>'; } } ?>
The only thing is that I want to show the_content of the grandchildren and not the_title. Any suggestions?
Changing this line to the_content is not working.
echo get_the_title($grandchild->ID);
Forum: Fixing WordPress
In reply to: Loop child pages displaying different content depending on depthThe theme is build by me ??
The last example worked good. It dosen’t post all the childpages though. Only a few. I need them to be posted in the same order as they’re listed in admin.
Forum: Themes and Templates
In reply to: Don't Remember if Logged in for CommentsDid u manage to do this? I’m trying to find the solution for this myself.
Forum: Hacks
In reply to: Don't want any login users at my comments.anyone?
Forum: Fixing WordPress
In reply to: Get the latest imageI solved it like this:
<?php $image[0] = ''; $images = get_children( 'post_type=attachment&post_mime_type=image&order=ASC&order_by=post_date&post_parent=' . get_the_id() ); foreach($images as $attachment_id => $attachment ) : ; $image = wp_get_attachment_image_src( $attachment_id, $size='thumbnail'); endforeach; ?>
Thanks for your help!
Forum: Fixing WordPress
In reply to: Get the latest imageIt works perfectly. Thank you!
Do you know a way to change the code to get the latest upload insted of the first?Forum: Fixing WordPress
In reply to: Get the latest imagethank you, I’ll try.
Forum: Fixing WordPress
In reply to: Pagination not working on single pagesAnyone?
Forum: Fixing WordPress
In reply to: Pagination not working on single pagesI forgot; I use <?php endwhile; ?> before the pagination.
Forum: Plugins
In reply to: [Plugin: Post Links] Different format not workingI solved this another way. It’s still not working though.
Forum: Fixing WordPress
In reply to: Different single-pages depending on page-IDHelp?