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
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
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;
Simply use a Custom Field with its name starting with an underscore, so it won’t show up in the CF meta box, eg, _field_name instead of field_name. It will be hidden for all roles, but if you are manipulating its value only through code, then no problem. If you need to manipulate the value on … Read more
If you are the only “Administrator” and the rest of the users is lower level roles it is possible to achieve this. ACF has the option to set a rule to only display it based on user role. Under “Edit Field Group” (where you setup the fields) there is a tab called “Location” where this … Read more