WordPress Thumbnail add action if no thumbnail
The hook the_post is not the right hook for this. You can add a filter to the_content, see http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content
The hook the_post is not the right hook for this. You can add a filter to the_content, see http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content
You cannot separate the markup from the output in this widget. The links are built from the result of mlp_show_linked_elements(), so you can use that to create the elements with a custom function or a new widget. This will print the links to all connected pages: mlp_show_linked_elements( array( ‘link_text’ => ‘text’, ‘show_current_blog’ => TRUE ) … Read more
I replaced it with: $out .= $instance->get_single( 1, ‘first’, “All”, 100, 1 ); And I changed the get_single function, more exactly I added a parameter, “all”, and this one won’t afect anything else. function get_single( $page, $class, $raw_text, $format=”%PAGE_NUMBER%”, $all = 0 ) { if ( empty( $raw_text ) ) return ”; $text = str_replace( … Read more
Widget content is stored in the $wpdb->options table as serialized data. You can search that with SQL because to SQL serialized data is just a string. SELECT option_value FROM {$wpdb->options} WHERE meta_value LIKE “something” But… The table is not indexed for that kind of search Searching serialized data is dicey anyway And I have no … Read more
Use get_the_author_meta(), this function returns data, it doesn’t display it. For example:– <?php $user_email = get_the_author_meta(‘user_email’); ?> For more information check it in the codex
functions.php conditional output for a single plugin
Yes, there are lot of plugins using CPTs as data holders (e.g., Advanced Custom Field). Others, though, carefully use the class WP_List_Table to conform to the default interface (e.g., BackWPup). When registering a post type, we have options to control its visibility and “querybility”: public, show_ui, publicly_queryable and others. This is how ACF registers itself: … Read more
You can just run a conditional check on the result of get_the_image(). Either it will have returned an image or not. if ( function_exists( ‘get_the_image’ ) ) { $image = get_the_image(array(‘echo’=>false)); if( ! empty ( $image ) ) { // do something with the image } else { // do something if there is no … Read more
After more digging, I finally stumbled across what I was looking for. Using the template_include filter is working for me. Plugin Templating within WordPress
Right, so the gist is your code; from your description I thought it was someone else’s code you read for inspiration. Your woostripe.php file, which loads your gateway class, bails out before loading the gateway class: // bail on constructor if gateway class isn’t loaded! if (!class_exists(‘WooStripe_Gateway’)) return; // … // why are you attempting … Read more