Insert content into head tag with function

The content is modified with filters, not hooks. To modify the <title>, use wp_title filter Example: add_filter(‘wp_title’, ‘set_page_title’); function set_page_title($orig_title) { return ‘Modified ‘ . $orig_title; }

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

post content and shortcode content displaying out of order

Replacing echo with return doesn’t work because your function is immediately terminated once it hits a return. See PHP docs for return. It would be helpful to see your actual code, but the general concept within your shortcode function would be: $output=””; // initialize output while( $your_shortcode_query->have_posts() ): $your_shortcode_query->the_post(); $foo = get_the_title(); $bar = get_permalink(); … 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(); } } ?>

Can you echo PHP code from a variable?

Since actual output seems to be done via echoing global variable nothing prevents you to change that variable to something else (between the points where theme creates and echoes it). Like a result of advertisement manager function call. However I think it would make more sense to stick with one of two functionalities rather than … Read more