How to get child pages and add unique class only to active page?
I made this by jQuery: $(‘.sidebar-list li a’).filter(function(){ return this.href === location.href; }).addClass(‘active’);
I made this by jQuery: $(‘.sidebar-list li a’).filter(function(){ return this.href === location.href; }).addClass(‘active’);
You can use the pre_get_posts action to set posts_per_page to -1 on the monthly archive pages. I said wrongly in a comment to use is_archive() as your conditional. The problem with is_archive() is, it returns true on all archives, which includes category and taxonomy archive pages as well. I would suggest to make use of … Read more
Updated answer: Use two floated lists to emulate columns, same approach as previously though. <?php /* Template Name: PageOfPosts */ get_header(); ?> <div id=”content”> <div class=”t”> <div class=”b”> <div class=”l”> <div class=”r”> <div class=”bl”> <div class=”br”> <div class=”tl”> <div class=”tr”> <div class=”pad”> <?php while( have_posts() ) : the_post(); ?> <?php $category = get_post_meta( get_the_ID(), ‘category’, … Read more
You are missing the declaration of the HTML select tag which options are his children so just add something like this: function myplugin_inner_custom_box() { // Use nonce for verification wp_nonce_field( plugin_basename( __FILE__ ), ‘myplugin_noncename’ ); // The actual fields for data entry echo ‘<label for=”myplugin_new_field”>’; _e(“Description for this field”, ‘myplugin_textdomain’ ); echo ‘</label> ‘; echo … Read more
No, but you can view the HTML source of the page and usually guess about some of them based on what is inserted into the page.
While I’m not completely sure what you’re trying to accomplish, you can use the following to programatically use a shortcode: echo do_shortcode(‘[DDET]Content goes here[/DDET]’);
Once you get $taxonomy you can perform further logic: $tax = get_taxonomy( $taxonomy ); if( isset( $tax->has_archive ) && $tax->has_archive == true ) { // do output. archive will be wordpress_url + $taxonomy->name ?> <p> <a href=”https://wordpress.stackexchange.com/questions/43340/<?php echo site_url( $taxonomy->name ); ?>”> <?php echo $tax->labels->name; ?> </a> </p> <?php } This is untested, but you … Read more
I don’t know of a standard wp url, but if you just want to know what pages are attributed to you on a particular website then you could try google – ie: https://www.google.co.uk/search?q=site%3Agetmedia.org.uk+therobyouknow ?
If you are trying to print children of a category, this should be sufficient: <?php wp_list_categories(‘orderby=id&show_count=1&use_desc_for_title=0&child_of=”.$term_id); ?> Details here: http://codex.wordpress.org/Template_Tags/wp_list_categories
First you need to fetch the current category, then grab posts. So, try <ul> <?php global $post; $category = get_the_category($post->ID); $args = array( ‘numberposts’ => -1, ‘offset’=> 1, ‘category’ => $category ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <li><a href=”https://wordpress.stackexchange.com/questions/56247/<?php the_permalink(); ?>”><?php the_title(); ?></a></li> <?php endforeach; ?> </ul>