Add a “default sorting” menu to child store pages

Take a look at whether or not your theme has an archive-product.php file in the woocommerce folder. This is a copy of the WooCommerce category template (which is displayed by archive-product.php. As long as your template has the do_action( ‘woocommerce_before_shop_loop’ ); action hook then the woocommerce_catalog_ordering() function should automatically be called with a priority of … Read more

Custom post type 404 error on “default” or “numeric” permalinks

The URL you are trying to access– mysite.com/reading-list/— is constructed by the WordPress rewrite rules. The path /reading-list/ doesn’t actually exist. If you are using the default ?p=123 links, those rewrite rules are not used. The default links are just GET strings. In other words, since there is nothing at mysite.com/reading-list/ without the rewrite rules … Read more

Plugin or shortcode for ISBN number?

I’ve had some help from a developer, and would like to share the solution: function get_google_tag( $isbn_metadata ) { return ( /* ‘<span class=”post-meta-key”>Preview: </span>’ . */ ‘<script type=”text/javascript” src=”http://books.google.com/books/previewlib.js”></script>’ . ‘<script type=”text/javascript”>’ . ‘GBS_insertPreviewButtonPopup(\’ISBN:’ . $isbn_metadata . ‘\’);’ . ‘</script>’ ); }

When I click on Add Product in woocommerce plugin, I get a blank white page [closed]

From http://wordpress.org/plugins/woocommerce/ Requires: 3.5 or higher This assumes you are using WooCommerce 2, if you are using a version below 2 then you don’t need to upgrade and it’s going to be something else. In either case you might be able to track the error down by enabling WordPress debug mode (http://codex.wordpress.org/Debugging_in_WordPress) and trying to … Read more

Activate a plugin via a SQL query

If your goal is automated plugin activation you don’t have to do it via SQL. You could, of course, but why not use functionality that comes with WordPress? As I mentioned in my comment, the data has been serialized so you just have to unserialize the data, add your plugin, re-serialize the data, and update … Read more

how can i show a google map in custom post type

$prop_mapaddress contains your textfield value: <?php if(isset($prop_mapaddress)) { global $post; global $wpdb; $fromat_address = trim($prop_mapaddress); $fromat_address = str_replace(” “,”+”,$fromat_address); $address_obj = file_get_contents(“http://maps.googleapis.com/maps/api/geocode/json?address=”.$fromat_address.”&sensor=false”); $address_obj =json_decode($address_obj); $latitude = $address_obj->results[0]->geometry->location->lat; $longitude = $address_obj->results[0]->geometry->location->lng; ?> <script> var geocoder; var map; var lat = “<?php echo $latitude ?>”; var lng = “<?php echo $longitude; ?>”; function initialize() { geocoder = … Read more

output the debug lines to the end of the page

Use the shutdown hook. It runs very late– “just before PHP shuts down execution” per comments in the source. Proof of concept: add_action( ‘shutdown’, function() { echo ‘This runs very late in the page load’; } );

Woocommerce product info in a sidebar?

Checkout the content-single-product.php WooCommerce template for an idea of what functions are hooked where. It is very well commented. When you learn about hooks and filters, all these questions start to become similar. You’ll want to remove the function from it’s current hook and add it to a new hook. This sample includes a fake … Read more