How to set up WP Cron in this scenario

I wanted to use WordPress built in WP Cron to update currency rates daily. I use this function currently, require_once(WP_PLUGIN_DIR . ‘/autocurupdate/currencyexchange_class.php’); $cx=new currencyExchange(); $cx->getData(); $currency_sql = “select last_updated from ” . $wpdb->prefix.”currencies where code = ‘PHP'”; $currency_1 = mysql_query($currency_sql); $currency_2 = mysql_fetch_array($currency_1); $last_updated = mysql2date(get_option(‘date_format’), $currency_2[‘last_updated’]); $current_date = $cx->Date; $currentdate = mysql2date(get_option(‘date_format’), $current_date); if($last_updated … Read more

Is there a way to make custom fields only editable by administrators?

I’ve found the following code that places custom fields into a user’s profile: <?php function extra_user_profile_fields( $user ) { ?> <h3><?php _e(“Roof Asset Information”, “blank”); ?></h3> <table class=”form-table”> <tr> <th><label for=”facility”><?php _e(“Facility”); ?></label></th> <td> <input type=”text” name=”facility” id=”facility” value=”<?php echo esc_attr( get_the_author_meta( ‘facility’, $user->ID ) ); ?>” class=”regular-text” /><br /> <span class=”description”><?php _e(“Please enter the … Read more

Selecting all posts from the children of a particular parent taxonomy

I’ve created a custom post type (minerals) with a custom taxonomy (location) which supports hierarchies. What I am trying to do is create a return according to the parent location of the mineral post type. For example, someone clicks on Europe, and the results show all minerals from all listed countries in Europe. Now the … Read more

Moving local wordpress page to a real server subdomain broke my permalinks?

I developed a site locally with /%postname%/ permalink structure. I did some sample posts locally and wanted to move this entire local setup to a temporary subdomain like http://review.clientsite.com. 1.) I exported the local sql table and imported it on the real database 2.) I changed the two fields inside the wp-options table to fit … Read more

How can I randomize a Nextgen Gallery Slideshow [closed]

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for WordPress Development Stack Exchange. Closed 7 years ago. Improve this question Been googling for an hour now can’t find the answer to what feels like a simple question. I have a very … Read more