Get a list of all links on a page?

it is possible to do on server side but you would have to create an output buffer and the either use Regex or Dom phrase to get all of the links. a much easier solution would be to use JavaScript or even better jQuery.

Explode() expects a string

Let’s start from the top: $current = get_the_category(); This returns an array of objects, one object for each category. $current_id= $current[0] ->cat_ID; This returns an object, the first object in the previous array $categs_list = get_category_parents($current_id); This returns a string, but only if the current category has parents; otherwise, it returns whatever was passed to … Read more

query_post problem

// Category should be ‘cat’ <?php $args = array( ‘cat’ => $cat, ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘post_type’ => ‘blog’, ‘post_status’ => ‘publish’ ); ?>

How to get sub-categories to display same look as there parents

If you have a single level of subcategories under your main categories, you can just do this: $category = get_category( $cat ); if( $category->category_parent ): $parent = get_cat_name( $category->category_parent ); echo ‘<h1>’ . $parent . ‘</h1>’; else: echo ‘<h1>’ . $category->cat_name . ‘</h1>’; endif;

Show posts from category specified using a custom field

Finally solved it! I needed to add this at the end of each loop 🙂 <?php $my_query = new WP_Query(array( ‘category_name’ => get_post_meta($post->ID, ‘featured’, true), ‘posts_per_page’ => 5, )); if ($my_query->have_posts()): ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> content etc goes here <?php endwhile; ?> <?php endif; ?><?php wp_reset_query(); ?> many thanks James