How to include wp-postviews plugin directly in the theme
That was so easy! I just included the plugin folder in my theme Then i included it. include(your-theme-path . ‘wp-postviews/wp-postviews.php’); That was it!
That was so easy! I just included the plugin folder in my theme Then i included it. include(your-theme-path . ‘wp-postviews/wp-postviews.php’); That was it!
Well, you can try my plugin ;), but almost every SEO plugin includes this functionality now, and there are several plugins which are kind of dedicated to it. If you want to code it yourself for whatever reason, all you need is basically to add a field in the user profile admin page in which … Read more
Prepare your custom widget, template function or shortcode. By template function I mean something like this: <?php function the_my_template_function(){ ?> <div>My content printed out</div> <?php } ?> which a WordPress user will call from it’s theme by inserting this piece of code into his theme: <?php the_my_template_function(); ?> It’s a common approach.
The Problem is that you include jQuery 1.9, in which the jQuery.browser was removed. Look at your functions.php, you will find a line in there saying wp_register_script or wp_enqueue_script with the parameter ‘jquery’. The URL you are loading jQuery from is ‘http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js‘, and you have to change it to ‘http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js‘. Please ask your developer to … Read more
You can do the following: <?php $post = $wp_query->post; $options = get_option( ‘sample_theme_options’ ); $authors = explode( ‘,’, $options[‘sometext’] ); if ( is_author( $authors ) ) { include ( TEMPLATEPATH . ‘/brand.php’ ); } else { include ( TEMPLATEPATH . ‘/customauthor.php’ ); } ?> This way, you’re always sure that $authors contains an array.
Try if ( isset($_GET[‘activated’]) && $_GET[‘activated’] == ‘true’ || isset($_GET[‘preview’]) && $_GET[‘preview’] == 1 ) instead of if ( $_GET[‘activated’] == ‘true’ || $_GET[‘preview’] == 1 ) Edit: You should wrap the if-sentence in the functions.php file into a function and a relevant hook. Here is an example using the after_theme_setup hook: add_action(‘after_theme_setup’,’my_theme_setup’); function my_theme_setup(){ … Read more
In your shortcode callback myshortcode_handler(), use a static variable: function myshortcode_handler() { static $first_call = TRUE; if ( ! $first_call ) { # callback was called earlier … } # set it to FALSE after you have handled the condition. $first_call = FALSE; return; } Please do not misuse the global namespace for this: avoid … Read more
In cases like this, open the plugin files in a good code editor and search for the elements you need, as there may be an useful hook. So, for this we have the filter wpseo_breadcrumb_single_link. Maybe you can replace span for li in $link_output, or use $link to build your own: add_filter( ‘wpseo_breadcrumb_single_link’, ‘filter_breadcrumb_wpse_88254’, 10, … Read more
Given that the page works if you leave the original query alone, your solution is pretty simple. Leave the original query alone. You don’t need to overwrite that query in order to created secondary loops. Instead of this: query_single(‘dealers’, ‘publish’, ‘1’, $taxtype, $value); if (have_posts()) : while (have_posts()) : the_post(); You want: $myq = new … Read more
How to do this is on the front of the plugins wordpress.org page. http://wordpress.org/extend/plugins/wp-maintenance-mode/ You can add your own html and stylesheet and add the url of this style to the options of the plugin. Write your style to this markup and upload to the webspace; after add the url include http:// to the settings … Read more