radiofranky
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: listing pages that are 2 levels upBlog (note: page id is 283)
-Blog Child (id 329)
–Blog grandchild (id 663)I want to get 283 from 663 and list all the available “blog child” under “blog” without displaying “blog grandchild”.
end result should look like:
blog child 1
blog child 2
blog child 3
…etcwithout blog nor blog grandchild
thanksForum: Fixing WordPress
In reply to: listing pages that are 2 levels upI was thinking this way. First get the ancestor ID from the child
$ancestors = get_post_ancestors($post->ID);
once I have the ancestors id I can pass it into wp_list_pages to list what’s under this ancestor. but somehow my try didn’t work.
if ($ancestors) { $parent = wp_list_pages('title_li=&depth=0&include='.$ancestors[count($ancestors)-1]); $children = wp_list_pages("depth=1&title_li=&child_of=".$parent."&echo=0"); } echo "<pre>"; print_r($ancestors); echo "</pre>"; echo "<pre>"; print_r($post); echo "</pre>"; echo "<pre>"; print_r($parent); echo "</pre>"; ?> <?php echo $children; ?>
Forum: Fixing WordPress
In reply to: listing pages that are 2 levels upthanks for your reply.
I tried the code, it shows the ancestor. But actually I would like to list what’s under this ancestor.
I did try to change depth = 0 but then it will display everything from
ancestor, parents, and child.
My goal is to display list of parents(not including child) that is under this specific ancestor.
again, thanks for the help
Forum: Fixing WordPress
In reply to: Show parent while on child pageHi,
I tried your code but it still display “child” in child page.
My structure is like this: catalog1 -> parent -> child
when I’m in child page, I would like to display list of parents(only, without any child) that are under catalog.basically, when I’m in child page, I would like to go back two stage up and read parents that are under “catalog1”.
your help is appreciated.
Forum: Fixing WordPress
In reply to: Parent children in sidebarHi,
thanks for the code. But i was wondering if you could help this.this is my structure
category1 -> parent -> child
I’m currently on child page and want to list all available parents only (without listing of other childs) under this specific category1.
thanks for your help
Forum: Themes and Templates
In reply to: Displaying Parent Page titlehi,
wp_list_pages(‘include=’.$post->post_parent}; works.
but I was wondering how to make this title not a link.thanks
Forum: Themes and Templates
In reply to: wp_list_categories link varbialeHi MichaelH,
I was wondering how to limit display to 8? and also is there a way to select categories randomly and display with get_cat_icon?thanks
Forum: Fixing WordPress
In reply to: Pull a random categoryhi,
I have this code in my home.php to display category + category icon.
i was wondering if is possible to select the category randomly?<?php recent_posts('limit=10&included_cats=538'); ?> <?php get_cat_icon('link=true&class=myicons&cat=538&description=true'); ?>
tried this but something is not right..
<?php $min_count=4; //minimum number of posts in term to consider $taxonomy = 'category'; $param_type = 'category__in'; $term_args=array( 'orderby' => 'name', 'order' => 'ASC', ); $allterms = get_terms($taxonomy,$term_args); // only terms that meet our $min_count if ($allterms) { $terms=array(); foreach( $allterms as $term ) { if ($term->count >= $min_count) { $terms[]=$term; } } } if ($terms) { $random = rand(0,count($terms)-1); //get a random number from 0 to number of elements in $terms array $term=$terms[$random]; $args=array( "$param_type" => array($term->term_id), 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => -1, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { recent_posts('limit=10&included_cats=$term'); } } wp_reset_query(); // Restore global post data stomped by the_post(). ?>
Forum: Fixing WordPress
In reply to: Dynamic post titles & thumbnails by date range?Hi steve35mm,
I was wondering what plugin did you use to get thumbnails from the vimeo video. Did you generate them manually or it’s done dynamically from vimeo?
thanks