Calling a plugin in theme development

You must check the documentation of the plugin. Is it supporting shortcodes? Do sometingh like <? do_shortcode(‘[plugin_shortcode]’); ?> Has function to call in the theme? Do something like <? my_plugin_function(); ?>

Call to undefined function issue

Christ, once again I was fighting with something for a few days straight and found a solution 20 minutes after asking on StackExchange. WHY? require_once(‘../../../wp-load.php’);

Theme Options: If There is No Input, Don’t Display?

Check if get_option returns a value and if it is not blank, then output the links. This should work for you: <?php if(get_option(‘to_facebook’) && get_option(‘to_facebook’) != ”) { ?> <a href=”https://wordpress.stackexchange.com/questions/34948/<?php echo get_option(“to_facebook’); ?>”></a> <?php } if(get_option(‘to_google_plus’) && get_option(‘to_google_plus’) != ”) { ?> <a href=”https://wordpress.stackexchange.com/questions/34948/<?php echo get_option(“to_google_plus’); ?>”></a> <?php } ?>

Loop through posts of a custom-post-type (event) and create .ics (iCal) file?

This is entirely based on Event Organiser (a plug-in I’ve developed). The code is lifted almost straight from the source but with alterations. As such I’ve not tested the code as given. Step 1: Create a feed This is simple: add_action(‘init’,’wpse63611_add_events_feed’); function wpse63611_add_events_feed(){ add_feed(‘my-events’,’wpse63611_events_feed_output’); } This adds a feed to your site: www.site.com?feed=my-events or www.site.com/feed/my-events … Read more

Create placeholder text for wordpress search box [closed]

Placeholder by itself will not disappear when you click the text field. I guess you need a bit of Javascript to achieve that. <input type=”text” onfocus=”if(this.value=='<?php _e( ‘Search here..’ ); ?>’){this.value=””;}” onblur=”if(this.value==”){this.value=”<?php _e( “Search here..’ ); ?>’;}” value=”<?php _e( ‘Search here..’ ); ?>”>

How do I test PHP files in WordPress?

The WordPress Codex documentation on Installing WordPress and Editing Files give you pretty much all information you need. You will need a web server to test the code and changes. So you can either do this on your web server (assuming you have some sort of hosting package, because you mention ‘upload’), or on your … Read more

How to display posts of specific category using a custom Query in WordPress?

the recommended way is: <?php $query = new WP_Query(‘category_name=Category&posts_per_page=4’); if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); if (has_post_thumbnail()) { ?> <a href=”https://wordpress.stackexchange.com/questions/162985/<?php the_permalink(” ‘) ?>” title=”<?php the_title(); ?>”><?php the_post_thumbnail(); ?></a> <?php } ?> <h2><a href=”https://wordpress.stackexchange.com/questions/162985/<?php the_permalink(” ‘) ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></h2> <?php the_excerpt(); // or the_content(); for full post content endwhile;endif; ?>