Help with WordPress function inside a shortcode

It looks like you’re using a php tag within a php tag. I’d try something more like this… <?php echo do_shortcode(‘[button type=”square” color=”black” size=”small”] Posted by ‘.get_the_author().’ [/button]’); ?> or something like this… <?php $shortcode=”[button type=”square” color=”black” size=”small”] Posted by “.get_the_author().’ [/button]’; echo “do_shortcode(‘$shortcode’)”; ?>

Get Page ID from Backend

Take a look this page from the codex. When creating a metabox, one of the options is a callback, which when called take a paramater for $post, which is the same as calling global $post ( as a side note, you can still do this in the backend Admin and get all the same variables. … Read more

Add title=”” to A PHP Code

Use the arguments available for the_post_thumbnail() function as written in the codex. Edit: just did a test with this and it worked for me: $post_title = the_title( ”, ”, false);//get the title $attr = array(‘title’ => $post_title);//set the parameter the_post_thumbnail(‘full’, $attr);//call the function

Help with page nav?

I would recommend using the WP_Nav Menu for your site. To use this feature, just add this in place of your current nav: <?php add_action( ‘init’, ‘register_my_menus’ ); function register_my_menus() { register_nav_menus( array( ‘primary-menu’ => __( ‘Main Menu’ ), ‘secondary-menu’ => __( ‘Secondary Menu’ ), ‘tertiary-menu’ => __( ‘Tertiary Menu’ ) ) ); } ?> … Read more

wordpress admin plugin menu custom css

Use the admin_head hook and just echo out what you need to: function my_admin_head() { // Custom Style echo ‘<link rel=”stylesheet” href=”‘.WP_PLUGIN_DIR.’/style.css” type=”text/css” />’; // Our JS echo ‘<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js”></script>’; } add_action(‘admin_head’, ‘my_admin_head’);

Almost Done… Post Format Code

You can utilize the WordPress function get_template_part(); Create several template files in your theme directory called content-POST_FORMAT_TYPE.php – Example: content-gallery.php and content-chat.php if(has_post_format(‘gallery’)) get_template_part(‘content’, ‘gallery’); elseif(has_post_format(‘chat’) get_template_part(‘content’, ‘chat’); else the_content(); This approach makes your code blocks reusable in multiple templates. Hope this helps you out.

WordPress gallery shortag

There is no way to limit the gallery query in the shortcode_gallery function. However, you can get the child attachments of a post using the following. $attachments = get_children( array(‘post_parent’ => $post->id, ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘order’ => $order, ‘orderby’ => $orderby, ‘numberposts’ => 5) ); You will need to … Read more

GET problem in WordPress

There are certain GET and POST calls that WordPress breaks. Such as title, name….If you are using those variables, I would change the name of them.