Limit ‘contributers’ abilities in WordPress

When you register your post type you can show/hide the UI in the arguments. I would approach it this way: $allowed = current_user_can(‘administrator’) ? true : false; $args = array( //other args ‘show_ui’ => $allowed ); //register_post_type() function; This will maintain the custom post type architecture while hiding the UI for those who are not … Read more

Display latest post from WordPress Featured Category that is also in X,Y,or Z categories

Maybe this could help and should return any post either in 2, 3 or 4 category AND in categoery 1 : query_posts( array( ‘cat’ => array(2,3,4), ‘category__and’ => 1, ‘posts_per_page’ => 1, ‘orderby’ => ‘title’, ‘order’ => ‘DESC’ ) ); (from codex http://codex.wordpress.org/Function_Reference/query_posts) Not quite sure, haven’t tested it.

Can not call .php files after switching to %postname%

What I assume is happening is when you are viewing a page with pretty permalinks, your relative URL breaks: submenu.php becomes http://yourdomain.com/pagename/submenu.php Try using .ajax instead: $.ajax({ type: “GET”, url: “http://localhost/submenu.php”, data: “cat=32” }).success(function(data) { $(‘#content’).html(data); }); This behavior wouldn’t happen using the standard URI query because no URI segments are added, therefore the browser … Read more

Function to add DIV Class?

Why not just check the options before calling dimox_breadcrumbs() like so: <?php // Check if the user wants breadcrumbs, default to “Yes” if no option set if(strcmp(get_option(“to_breadcrumbs”, “Yes”), “Yes”) == 0){ if (function_exists(‘dimox_breadcrumbs’)) { dimox_breadcrumbs(); } } ?>

display sticky post outside loop and exclude from loop

Before your loop do: $args = array( ‘ignore_sticky_posts’ => 1 ); $query = new WP_Query( $args ); // The Loop while ( $query->have_posts() ) : $query->the_post(); echo ‘<li>’; the_title(); echo ‘</li>’; endwhile;

How to get the second slug of a page url?

This problem can be solved with the WordPress Rewrite API The simplest way I assume that you’ve created a page called year and the request is most probably matched to this rule (.+?)(/[0-9]+)?/?$, with the query rewritten to pagename=year. However, you will notice from the regular expression that an additional / can be matched to … Read more