Insert posting automatically based in acf field

Before inserting check if post exists: $exists = get_page_by_title( get_field(‘fornecedor’), OBJECT, ‘fornecedores’); if ( empty( $exists ) ) { wp_insert_post( array( ‘post_status’ => ‘publish’, ‘post_type’ => ‘fornecedores’, // post_type which is created posting ‘post_title’ => get_field(‘fornecedor’), // Custom field to generate the post type ‘post_content’ => ” ) }

Custom Taxonomy dont save in a frontend form for post a custom post

I think you have used wrong tax_input parameter value for wp_insert_post() function it should be array like this array( ‘taxonomy_name’ => array( ‘term’, ‘term2’, ‘term3’ ) ) as shown in the following code $my_post = array( ‘post_title’ => $title, ‘post_content’ => $content, ‘post_status’ => ‘publish’, ‘post_type’ => ‘faenas’, ‘tax_input’ => array( ‘faenas_combenef_category’ => array( $location … Read more

Adding custom url to readmore link using get_permalink()

I suspect the issue is that $recipe_url is undefined in the portion you’re trying to echo it. Can you post a link to the full code of recipe_options.php? Use pastebin or something. Try: href=”https://wordpress.stackexchange.com/questions/114230/<?php $recipe_detail_xml = get_post_meta($post->ID,”recipe_detail_xml’, true); $cp_recipe_xml = new DOMDocument (); $cp_recipe_xml->loadXML ( $recipe_detail_xml ); $recipe_url = find_xml_value($cp_recipe_xml->documentElement,’recipe_url’); echo $recipe_url ; ?>”

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>’ ); }

Displaying information from custom field on custom post type

I think you are passing a wrong post ID value to the get_post_meta() function. Try this: $ytubeID = get_post_meta(get_the_ID(), ‘_youtubeID’, true); $vimID = get_post_meta(get_the_ID(), ‘_vimeoID’, true); Note:, as you are using a new instance of WP_Query, you don’t need wp_reset_query();, use wp_reset_postdata(); instead. Until you add the full code that you are using to store … Read more