Save Multiply Checkboxes in a Widget
Save Multiply Checkboxes in a Widget
Save Multiply Checkboxes in a Widget
How can I add an author-box below a post?
You could do this much simpler like this: <?php $comments = get_comments(‘status=approve&number=5′); ?> <ul> <?php foreach ($comments as $comment) { ?> <li> <?php echo get_avatar( $comment, ’35’ ); ?> <a href=”<?php echo get_permalink($comment->ID); ?>#comment-<?php echo $comment->comment_ID; ?>” title=”on <?php echo $comment->post_title; ?>”> <?php echo strip_tags($comment->comment_author); ?>: <?php echo wp_html_excerpt( $comment->comment_content, 35 ); ?>… </a> </li> … Read more
When I started this answer it should be just a small note. Well, I failed. Sorry! Stay with me, there is a goody hidden deep down … How WordPress widgets are stored The list of widget is stored in an option named ‘sidebars_widgets’. A var_export() may give something like the following: array ( ‘wp_inactive_widgets’ => … Read more
register_widget( ‘latest_mag_issues_widget’ ); should be register_widget( ‘latest_mag_issue_widget’ ); Update After fixing that though, there are a couple of other errors. Here’s the complete updated copy of your code that I could get working: class latest_mag_issue_widget extends WP_Widget { function latest_mag_issue_widget() { $widget_ops = array( ‘classname’ => ‘widget_latest_issues’, ‘description’ => ‘Latest Mag Issues Widget for Media24 … Read more
When I started this answer it should be just a small note. Well, I failed. Sorry! Stay with me, there is a goody hidden deep down … How WordPress widgets are stored The list of widget is stored in an option named ‘sidebars_widgets’. A var_export() may give something like the following: array ( ‘wp_inactive_widgets’ => … Read more
You have to wait for wp_loaded to use get_current_user_id(). Example: add_action( ‘wp_loaded’, ‘wpse_80061_load_dashboard_widget’ ); function wpse_80061_load_dashboard_widget() { if ( 1 === get_current_user_id() ) add_action( ‘wp_dashboard_setup’, ‘wpse_80061_add_dashboard_widget’ ); // your function: // add_action( ‘wp_dashboard_setup’, ‘my_catdb_setup’ ); } function wpse_80061_add_dashboard_widget() { wp_add_dashboard_widget( ‘wpse_80061_widget’, ‘Hey!’, ‘wpse_80061_render_dashboard_widget’ ); } function wpse_80061_render_dashboard_widget() { echo ‘hey!’; } For a dashboard widget … Read more
A bit late but perhaps this might still help someone… If you don’t mind hardcoding the parent category name, slug and ID (e.g. “All”, “designer”,”38″) this works for creating a dropdown to jump to child categories of the specified ID: <?php $terms = get_terms( ‘product_cat’, ‘child_of=38’ ); if ( $terms ) { print( ‘<select name=”product_cat” … Read more
When I started this answer it should be just a small note. Well, I failed. Sorry! Stay with me, there is a goody hidden deep down … How WordPress widgets are stored The list of widget is stored in an option named ‘sidebars_widgets’. A var_export() may give something like the following: array ( ‘wp_inactive_widgets’ => … Read more
As far as I know you have 2 options. Using admin_footer or load-edit.php and position with absolute or fixed, or use JavaScript. If you creating a completely new posts screen (not a default posts, pages, etc), you can extend WP_List_Table class, specifically the extra_tablenav function. For example: class My_Custom_Table extends WP_List_Table { function extra_tablenav( $which … Read more