Getting URL Variables with a Rewritten Page (Login Page)

If you want instead of redirect to wp-login the user redirect to login page then use the following code. It will redirect user to login page where login form is present. add_filter(‘site_url’, ‘wplogin_filter’, 10, 3); function wplogin_filter( $url, $path, $orig_scheme ){ $old = array( “/(wp-login\.php)/”); $new = array( “login/”); return preg_replace( $old, $new, $url, 1); … Read more

Custom Post Type children and grand-children in one list

When i lost track with all the crappy code, i decided to start all over 🙂 And so i found the solution: <?php // Define variables $post_type=”file”; $taxonomy = ‘file-category’; $taxonomy_terms = get_terms($taxonomy); global $current_page_id; $current_page_id = get_the_ID(); // Start if if ($taxonomy_terms) { // Start Foreach foreach ($taxonomy_terms as $taxonomy_term) { // Start arguments … Read more

Is there a way to target only images within the loop?

That depends. There is the_post_thumbnail which will echo the “featured” image and get_children can grab all attachments. Certain kinds of images aren’t attached though, so you can’t easily get those. Reference http://codex.wordpress.org/Function_Reference/the_post_thumbnail http://codex.wordpress.org/Function_Reference/get_children

Transient Loop Not working as expected

What is the code on line 3645? You didn’t specify. From what I see in your code, $transient_name should be something like “_my_post_list_transient” – a string. If $transient_name is returning a post object, then your call to this function may be the problem.

Retreive tags from attached post for media on page

‘attachment’, ‘posts_per_page’ => -1, ‘post_status’ => ‘any’, ‘post_parent’ => null, ‘tax_query’ => array( array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘slug’, ‘terms’ => ‘logo’ ) ) ); $images = get_posts( $args ); if ( $images ) { foreach ( $images as $image ) { // Get the parent post ID $parent_id = $image->post_parent; // Get the … Read more