why css file not link?how to create permalink?
why css file not link?how to create permalink?
why css file not link?how to create permalink?
You made 2 small errors. First of all: Shortcode-Functions receive a maximum of 2 parameters: $attributes and $content. $attributes is an array of all the attributes within the shortcode, like [shortcode post_id=123] the attribute post_id will end up in the $attributes array as $attributes[‘post_id’]. $content has the content between the opening and the closing shortcode … Read more
thumbnail_width not working in wordpress most popular post plugin
qTranslate‑X is not translating all shortcodes
You can use get_query_var(‘paged’), this will return the current page in pagination. $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; Or the shorter form $paged = get_query_var(‘paged’) ?: 1;
You would need to do this in the shortcode function for [api_request]. Here’s a potential answer with a ternary that would check if the $_POST value exists, if so, sanitize and use it, otherwise use the value passed in the shortcode: $q = ( isset( $_POST[‘q’] ) ) ? sanitize_text_field( $_POST[‘q’] ) ? $atts[‘q’]; This … Read more
Use the attribute value to decide today and tomorrow like: Code explanation: Instead of today and tomorrow naming in shortcode, I’m using show_for in this answer. Based on show_for value we can update the meta query later on. In the code, I checked if show_for is set by user or it exists in the $atts … Read more
Use $add_number if $sub_number is 0, else use $sub_number: $sorting = null; $paging = array( ‘offset’ => 0, ‘page_size’ => $page_size ); $entries = GFAPI::get_entries($formid, $search_criteria, $sorting, $paging); $countentries = GFAPI::count_entries( $formid, $search_criteria ); if(!$sub_number) { $countentries_add = $add_number + $countentries; if ( !empty( $number_field ) ) { $gwp_count = $add_number; for ($row = 0; … Read more
Firstly you can upload the image using wp_media_handle as it returns attachment id. Then try to add your desired metafields by passing the same id in each of them.
The do_shortcode function accepts a string, searches the string for shortcodes, and processes any that are found. That means that… // Use shortcode in a PHP file (outside the post editor). echo do_shortcode(”); … is all you need to run a shortcode (code taken from the Codex). Your request that the shortcode be inserted “somewhere … Read more