Header links also appearing in the footer
The correct way to get a specific menu is the ‘theme_location’ parameter: wp_nav_menu(array(‘theme_location’ => ‘main_nav’)); wp_nav_menu(array(‘theme_location’ => ‘footer_links’));
The correct way to get a specific menu is the ‘theme_location’ parameter: wp_nav_menu(array(‘theme_location’ => ‘main_nav’)); wp_nav_menu(array(‘theme_location’ => ‘footer_links’));
The capabilities are stored as user meta data in a serialized array for each site. The key as a regular expression would look like that: ‘~’ . $GLOBALS[‘wpdb’]->base_prefix . ‘(\d+)_capabilities~’ So … get the user meta data, find the capability strings (they hold the roles), and compare the unserialized result with the role you want … Read more
You can use get_post_ancestors() (codex) to get an array of all the ancestors id’s, so if I understand you correctly you might want to use child_of=”.end(get_post_ancestors($post->ID)) instead of child_of=”.$post->post_parent where end() (php doc) gives you the last element of the array.
Well yes but compared to what? Any query on the DB is going to add server load and thus page load so your question is not very useful without context. The PHP code WP uses to order posts randomly is found in query.php: case ‘rand’: $orderby = ‘RAND()’; Which results in the output like: SELECT … Read more
The difference between the two is that the test site has pretty permalinks enabled and the live site doesn’t. If you look at the URL, the issue becomes apparent, this is not a valid URL/query string: http://www.veredor.com/?page_id=140?register=true If you change the second ? to an ampersand, the page renders correctly. Either enable pretty permalinks on … Read more
get_the_term_list & url
Firstly, do you have DEBUG set to TRUE in wp-config? Not loading further than the header may well mean there’s an error that isn’t displaying. Set it to True to see the error. Secondly, you are using for in_category on an archive page – which I believe would only apply to the first post on … Read more
Your problem is you have: foreach post where A is true, that has a child where B is true Which is actually: foreach post where A is true that has a child where B is true So this is not something you should be doing in 1 query. Instead you would need to do n … Read more
You could do something like this to rewrite rules for author titles, check out the monkeyman rewrite analyzer to figure out, following code should be in your functions.php add_filter(‘rewrite_rules_array’, ‘my_insert_rewrite_rules’); function my_insert_rewrite_rules($rules) { // Implement this function to add all the new rules to $rules array passed in $newrules = array(); $authors=get_users();//http://codex.wordpress.org/Function_Reference/get_users foreach($authors as $author) … Read more
You can’t execute PHP code from within a string. You can however define a function that executes code and call that function within your if clauses. function dz_slick_longstring() { $query = new WP_Query(‘category_name=intro-paragraphs’); if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); ?> <div class=”mid-box”> <h1><?php the_title(); ?></h1> <?php echo excerpt(40); ?><br/> <a href=”<?php echo get_permalink(); ?>”>» read more…</a> … Read more