Show parent categories of the current category

Another way to go about it instead of substring, would be to use implode/explode & array filter. echo implode(” » “, array_filter( explode(” » “, get_category_parents( $cat, true, ” » “) ) ) ); Breaking that down: Start with your original string. $string = get_category_parents( $cat, true, ” » “); Explode the string using your … Read more

call adminbar greeting in other place

If I got you right, then you don’t want to show other details than the greetings in the front end admina bar. If that is so then you can use Remove Node to make this work. You can use it like below for only greetings and other options in it to display First remove the … Read more

How to get all the items of a taxonomy even if it does not have a custom post type?

Add a hide_empty argument: $termsq = get_terms(“competence”,array(‘hide_empty’=>false)); See the Codex for the complete argument list. Additionally, get_terms will return a WP_Error object on failure, so your count check won’t work. You need is_wp_error. $termsq = get_terms(“competence”,array(‘hide_empty’=>false)); if (!is_wp_error($termsq)) { echo “<ul>”; foreach ( $termsq as $termq ) { echo “<li>” . $termq->name . “</li>”; } … Read more

Make next post button link to random post

The code you posted does nothing but display. The code you need to alter is whatever is creating $prevID and $nextID, but that might not be entirely relevant. Basically, you just need to grab a random post. $rl = new WP_Query( array( ‘posts_per_page’ => 1, ‘orderby’ => ‘rand’, ‘fields’ => ‘ids’ ) ); ?> <div … Read more

Execute Jquery when a specific page in my plugin is loading

You’ll need to get the screen id on the screen (or page) in question using get_current_screen() get_current_screen()->id Then, hook into it with the following: function my_script_function() { if ( strpos( get_current_screen()->id, ‘screen_id’ ) !== false ) { wp_enqueue_script( ‘my_javascript_handle’, ‘path/to/my/script.js’, ‘jquery’, ‘1.0’ ); } } add_action( ‘admin_enqueue_scripts’, ‘my_script_function’ ); This will enqueue your script properly … Read more

Trying to split a query into sections of six

I think your approach is correct but you’re running into the “posts_per_page” problem. In your query, use ‘posts_per_page=-1’ to return all posts (assuming that’s what you want). I’m guessing your website is currently set to show 12 posts per page in the settings->reading area. http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters

First post article different on Archives template

Just point to the first element of your list of articles using CSS pseudo class like this: PS. I’m so used to less that I’m gonna give you the .less syntax, but you can figure it out on your own right? .container-with-your-posts { > .post-container { &:first-child { h1 { your styles for the title … Read more