Call plugin with php function
Depending on what you want you’ll need to use the the_widget function, I believe there are few examples of using it in the WordPress twentyeleven theme as well.
Depending on what you want you’ll need to use the the_widget function, I believe there are few examples of using it in the WordPress twentyeleven theme as well.
The way I handle these is to store to use template_include to conditionally pass my plug-in template. One of these conditions is that the corresponding file hasn’t already been found by WordPress (i.e. isn’t present in the theme folder). This means that users can over-ride the plug-in template with a theme-specific one by simply creating … Read more
This would probably best be solved with a custom post type for the Exhibit. That will give you a new section in the admin-area with posts/pages for each exhibitor. That way you can for example use: Post thumbnail as “exhibitor_logo_img” The post title as “exhibitor_title” The content area as “exhibitor_bio” And if you need the … Read more
Ok, this has worked for me. <?php // get the track list global $nggdb; $gallery = $nggdb->get_gallery ($galleryID, ‘sortorder’, ‘ASC’, true, 0, 0); ?> <div id=”tracklist”> <?php foreach($gallery as $image) { ?> <div class=”single_image” id=”image-<?php echo $image->pid; ?>”> <a href=”https://wordpress.stackexchange.com/questions/75475/<?php the_permalink() ?>&pid=<?php echo $image->pid;?>” title=”<?php echo $image->title; ?>”> <?php echo $image->alttext; ?> </a> </div> <?php … Read more
Short explanation The $wpdb->prepare() method works similar to sprintf()/printf() and therefore needs more than one argument (else it’s senseless to use it at all). So if one of your plugins or the theme makes a DB call, which is prepared to protect you against cross script attacks and similar and doesn’t do it properly, WordPress … Read more
You could try hooking into template_include and showing the user a completely different page containing the login form (without changing the URL) if the post is password protected. Combine that WordPress’ built in post password functionality and you have something really close to what you want (blocking an entire page). You could also use {{insert … Read more
I have no experience with this plugin. But when I look at the source, I think something like this should do it: add_filter( ‘wypiekacz_check_post’, ‘wpse_78395check’ ); function wpse_78395check( $errors ) { if ( empty ( $_POST[‘custom_field_name’] ) ) $errors[] = array ( ‘unique_error_key’, __( ‘Custom error message’, ‘your_textdomain’ ) ); return $errors; } Replace all … Read more
You can’t insert multiple rows via wpdb’s insert, you have to do it with raw SQL: INSERT into $meta_table (post_id, meta_key, meta_value) VALUES (‘val1’, ‘val2’, ‘val3’), (‘otherval1’, ‘otherval2’, ‘otherval3’) However- You should always use the API where a function exists- use add_post_meta so your plugin integrates with the WordPress environment and its behavior can be … Read more
Comparing the markup generated by page.php when the cart is displayed, it seems that the content is generated by cart.php, similarly to loading a template part, so cart.php is actually used whenever the cart is displayed.
Check the parent of each category, top-level terms will have a parent value of 0: $product_category = wp_get_post_terms( $post->ID, ‘product_cat’ ); foreach( $product_category as $cat ): if( 0 == $cat->parent ) echo $cat->name; endforeach;