Multisite – Cloning CPT pages + content (including ACF Flexible Content) from site to site
Multisite – Cloning CPT pages + content (including ACF Flexible Content) from site to site
Multisite – Cloning CPT pages + content (including ACF Flexible Content) from site to site
Automatic duplicate/copy of post to a related page in WordPress
I’m trying to remove a duplicate menu, which only appears on the homepage?
You can run a WP_query using meta_key and meta_value args Take a look here WP_User_Query If the result is non – empty – you know you have a duplicate!
Unfortunately no one answers my question so I will show my way to solve this problem. I use public query vars with get_query_var and set_query_var functions to set widget__exclude variable across all queries. Still not sure that it is the best way for this case but hope it helps somebody.
Fixed it. After all it was really dumb error on my part. The WP_Query() does not filter out unpublished posts by default. The internal archive page query does filter these posts out. I had to add ‘post_status’ => ‘publish’ to the $query_args array and everything is now working as expected. The final query then looks … Read more
This can get a bit demanding to get it right so this following snippet should provide the basic upon which you can research and build a more complete solution: add_action( ‘template_redirect’, function() { if ( is_category() ) { $term = get_queried_object(); if ( isset( $term->parent ) && $term->parent ) { global $wp; $request_url = trailingslashit( … Read more
You can add your one… /* * Function creates post duplicate as a draft and redirects then to the edit post screen */ function rd_duplicate_post_as_draft(){ global $wpdb; if (! ( isset( $_GET[‘post’]) || isset( $_POST[‘post’]) || ( isset($_REQUEST[‘action’]) && ‘rd_duplicate_post_as_draft’ == $_REQUEST[‘action’] ) ) ) { wp_die(‘No post to duplicate has been supplied!’); } /* … Read more
I would do this using advanced custom fields to setup a field set with X and Y, then build a custom post template where the non-dynamic text is hard coded and us the_field(field_id) function to run a query and pull through your dynamic fields. I’m not sure what your technical abilities are but that would … Read more
Ended up with using this code: <?php query_posts(‘category_name=Menucard’); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class=”span4 post move pull-left”> <?php //echo post here the_content(); ?> </div> <!– close .post div –> <?php $counter++; if ($counter % 3 == 0) { echo ‘<div style=”clear:both;”></div>’; } ?>