How to add ASCII symbol after each recent post [closed]

Are you talking about (something like) this: <?php $args = array( ‘numberposts’ => 2, ); $recent_posts = wp_get_recent_posts($args); foreach ($recent_posts as $recent) { ?> <li> <a href=”https://wordpress.stackexchange.com/questions/127441/<?php echo get_permalink($recent[“ID’]); ?>” title=”<?php echo esc_attr($recent[“post_title”]); ?>”> <?php echo $recent[“post_title”]; ?> </a> &gt; </li> <?php } ?> If so, what was the problem?

is user member of a group, show them categories [closed]

You should probably try this plugin first: http://buddydev.com/buddypress/blog-categories-for-groups-plugin/ Or you could take some code from it and try to implement that yourself. Start with blog-categories-for-groups.php, and see the last few lines: //for single post screen function screen_group_blog_single_post(){ global $bp; if(function_exists(‘bp_is_group’)&&!bp_is_group()) return; //do not catch the request for creating new post if(bp_is_action_variable(‘create’,0)) return; $current_group=groups_get_current_group(); if(bcg_is_disabled($current_group->id)) return; … Read more

How to add title attribute to archive items

If you look at the source, you will see that the HTML is generated by get_archives_link, which applies the filter get_archives_link. Applying a callback to that filter is probably the most straightforward way to add a title attribute. Unfortunately it is not one of the more friendly filters and requires you to regex the generated … Read more

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