posting twice from an array?

You could try something like this: $postTitle=””; // save post title if(isset( $_POST[‘submit’])){ // if submit button is present $vergoeding=$_POST[‘vergoeding’]; $extrakosten=$_POST[‘extrakosten’]; for ($i=0; $i < count($vergoeding); $i++) { $new_post = array( ‘post_title’ => $postTitle, ‘post_content’ => ‘ ‘, // can not be empty ‘post_status’ => ‘publish’, ‘post_type’ => ‘landschapselement’ // custom post type ); $pid … Read more

Advanced Custom Fields and date picker, show posts only if the day is today no matter the year

It’s a little complicated, but we can do this by directly modifying the query with a filter on posts_where. We’ll start with a query for posts with a meta value of today’s date, this is assuming a date format of yyyy-mm-dd: $date_today = date(‘Y-m-d’); $args = array( ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ … Read more

Memberpress isn’t cooperating with WooCommerce

Just solved this. Under memberpress options, we had to uncheck the option to “Keep members out of the WordPress Dashboard”. That was it! I think the woocommerce checkout page was using ajax to call “admin-ajax.php”. Memberpress was preventing users from accessing this page so it brought up the login redirect page instead. We’ll keep users … Read more

wp_get_attachment_link() add rel attribute if the link points to direct image

add_filter( ‘wp_get_attachment_link’, ‘sant_prettyadd’, 10, 6); function sant_prettyadd ($content, $id, $size, $permalink, $icon, $text) { if ($permalink) { return $content; } $content = preg_replace(“/<a/”,”<a rel=\”prettyPhoto[slides]\””,$content,1); return $content; } Update: function sant_prettyadd checks permalink argument. if the permalink = true then it returns the content as it is. if the permalink = false then it skips to … Read more

a slider menu is compromised in space

I can see the problem is that max-height: 120px is set in the inline css of <div id=”soliloquy-container-1124″ class=”soliloquy-container soliloquy-fade”>. Removing that style solves the issue.

options validator input is false?

This kind of setup skeleton works for me to process the custom options page input : <?php /* Plugin Name: Settings Skeleton */ if(!class_exists(‘MySettings’)){ function call_my_settings() { return new MySettings(); } if (is_admin()){ add_action( ‘init’, ‘call_my_settings’ ); } class MySettings{ public function __construct(){ add_action(‘admin_menu’, array(&$this, ‘add_menu’)); add_action(‘admin_init’, array(&$this,’settings’) ); } public function add_menu(){ add_options_page(__(‘My Plugin … Read more