felipedario
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Show content from parent page on childrenThanks, esmi.
So I guess I’m making a little progress:
<?php foreach ($ancestors as $page_id ) : if( $post -> post_parent == $page_id ) { $parent_title = get_the_title($post->post_parent); $parent_link = get_permalink($post->post_parent); echo $parent_title; echo $parent_link; } endforeach; ?>
does print the title and permalink of the parent.
But I don’t know how to use html inside an echo. Do you have any tutorial to point or tip?
Thanks again!
Forum: Fixing WordPress
In reply to: Show content from parent page on childrenWordPress is getting an error with line 6, “unexpected T_AS”.
<?php $ancestors = get_ancestors($post->ID, 'page' ); echo "<pre>"; print_r($ancestors); echo "</pre>"; ?> <?php foreach (($ancestors as $page_id ) : if( $post -> post_parent == $page_id ) echo 'Page parent!'; endforeach; ?>
This prints the direct parent id, but I still don’t see how to get it’s the_title and post_meta, for example:
<?php echo current($ancestors); ?>
Thanks for helping this noob (:
Forum: Fixing WordPress
In reply to: Show content from parent page on childrenI’m using outside the Loop right now, but I can move it within.
Forum: Fixing WordPress
In reply to: Show content from parent page on childrenThank you very much, esmi!
So, using
<?php $ancestors = get_ancestors($post->ID, 'page' ); echo "<pre>"; print_r($ancestors); echo "</pre>"; ?>
I got
Array ( [0] => 25 [1] => 23 )
I just want to show the direct parent, “25”, not the grandparent, “23”. Do you know how to get just the direct parent?
Also, could you show a pratical way to make the loop work?
Thank you again.
Forum: Plugins
In reply to: [WP-PageNavi] [wp-pagenavi] does not workThe
<?php wp_pagenavi(); ?>
is on my template file, the plugin is active and the settings are default, but nothing appears in the page or in the source code, as if the<?php wp_pagenavi(); ?>
wasn’t there, or there was only one page of content (which isn’t the case).There’s also no error message, like if the plugin wasn’t active.
Forum: Plugins
In reply to: [WP-PageNavi] [wp-pagenavi] does not workSame problem with me.
Forum: Fixing WordPress
In reply to: Administrator can’t view Draft postsDid you found a solution? I have the same problem here.
Forum: Fixing WordPress
In reply to: Comments appearing in wrong postsLillaMy, how did you made it exactly? Thanks!