Embedding PHP in shortcode $content
<?php echo do_shortcode(“[apply]<a href=”” . site_url() . “/quick-quote”>Quick Quote</a>[/apply]”); ?>
<?php echo do_shortcode(“[apply]<a href=”” . site_url() . “/quick-quote”>Quick Quote</a>[/apply]”); ?>
You should be using wp_register_script() and wp_enqueue_script(), so, for example: add_action( ‘wp_enquque_scripts’, ‘my_script_enqueue’ ); function my_script_enqueue() { wp_enqueue_script( ‘my-jquery’, ‘URL TO THE FILE’, array( ‘jquery’ ) ); } Also, as mentioned by Zack, you should be registering your jQuery as such, as wordpress does not use $ for jQuery by default. jQuery( document ).ready( function( … Read more
You don’t need custom rewrites for that, you can simply use the permalinks settings to achieve those results. Click the Custom Structure option and enter: /blog/%year%/%monthnum%/%postname%.html
While this was far from clear in the OP at first, I think this might be a good solution. Just make a shortcode to place the excerpt in the body. (This is a bad idea if you want this on every page. This is a good idea if you want it once in a while … Read more
Just follow the code :). Before calling wp(), /wp-blog-header.php loads /wp-load.php (which assuming you have correctly installed WordPress) loads /wp-config.php. At the bottom of that file, it calls /wp-settings.php. This file loads a lot of other files, initialising the core parts of WordPress. Amongst them, is the wp-includes/functions.php file. It’s inside this file that wp() … Read more
Start by reading the notices–they tell you very explicitly what the problem is. Let’s start with the first one: Notice: Undefined index: _wr_event_speaker in /Users/my/htdocs/wr/wp-content/themes/wr/functions.php on line 246 First, this is just a “notice”. Meaning that no error has actually occurred. PHP is just telling you that something isn’t quite right, but that it skipped … Read more
Drop this in your functions.php or a custom plugin. function wpse_57621_alo_tidy() { if ( $page_id = get_option( ‘alo_em_subsc_page’ ) ) { if ( ! is_page( $page_id ) ) remove_action( ‘wp_head’, ‘alo_em_ajax_js’ ); } } add_action( ‘wp’, ‘wpse_57621_alo_tidy’ ); It’s attached to the wp hook, which runs just after the request has been handled & queried. … Read more
Query the posts like you are known to it, but then get all posts and restructure them for the order you need it. Take care of setting up the global $post variable your own so that to ensure you template code still works. The array_chunkDocs function normally comes in handy for column based output: $query … Read more
Isn’t it because you’re using $crop as true, as the 4th parameter for the add_image_size() function? This will crop the image and does not actually resize the image.
I would keep out of your header.php & either add the following to your functions.php or wrap up as a plugin: add_action( ‘wp_head’, ‘wpse_71766_seo’ ); /** * Add meta description & keywords for single posts. */ function wpse_71766_seo() { if ( is_single() && $post_id = get_queried_object_id() ) { if ( ! $description = get_post_field( ‘post_excerpt’, … Read more