Creating Features List in WordPress Post

Convert the items in the shortcode into an array, and return a list: add_shortcode( ‘features_list’, ‘shortcode_features_list’ ); function shortcode_features_list( $atts = array(), $content=”” ) { $content = trim( $content ); if ( ” === $content ) return; $items = explode( “\n”, $content ); $items = array_map( ‘trim’, $items ); return ‘<ul class=”features”><li>’ . join( ‘</li><li>’, … Read more

PHP Syntax getting PHP terms

I prefer to use get_the_ID() for things like that, which will return the ID of the current page/post. $mjrelatedproducts = get_brands( get_the_ID() )->slug; That should return the slug of the current page/post.

How can I list only Subcategories in Woocommerce

You can try this. $args = array( ‘parent’ => 100, // id of the direct parent ‘hide_empty’ => false, ); $cats = get_terms( ‘product_cat’, $args ); foreach( $cats as $cat ) { // do your loop stuff here } Here is more information on this function and additional arguments you can use.

get value from post to sidebar

You did not explain your question well so I am guessing quite a bit but I think you want something like this: function post_ids_wpse() { global $wp_query; $ids = wp_list_pluck($wp_query->posts,’ID’); $scs=””; foreach ($ids as $id) { $scs .= “[wp_value id='{$id}’]”; } echo do_shortcode($scs); } That is very crude. You should check that the various values … Read more

PHP Warning missing Argument 1 for __()

you get this error if you passed empty string or did not pass any argument to the __() function. You should check where you’ve used the __() function and check what value is being passed as argument.

Php inside the shortcode is getting commented

You can not execute functions inside the do_shortcode() call like you are trying to. If you are just trying to wrap your post meta content with the shortcode, then you can do it like shown below. $your_post_meta_variable_content = get_post_meta( $postid, principal_1, true ); echo do_shortcode( ‘[learn_more caption=”ancila”]’ . $your_post_meta_variable_content . ‘[/learn_more]’ );

Meta Box plugin image_advanced not showing up on frontend

I figures this out. Here is the code that worked: $images = rwmb_meta( ‘mostfilms_onesheet’, ‘type=image_advanced&size=full’ ); foreach ( $images as $image ) { echo “<img src=”https://wordpress.stackexchange.com/questions/190698/{$image[“url’]}’ width=”https://wordpress.stackexchange.com/questions/190698/{$image[“width’]}’ height=”https://wordpress.stackexchange.com/questions/190698/{$image[“height’]}’ alt=”https://wordpress.stackexchange.com/questions/190698/{$image[“alt’]}’ />”; }

changed front-page template gives 500 error

It seems like you might have done some syntax error etc please add these lines to wp-config.php to check error If you have backup of your previous file, restore it to check error if any are there. error_reporting(E_ALL); ini_set(‘display_errors’, 1); define( ‘WP_DEBUG’, true); 500 errors can frequently occur with incorrectly configured rewrite rules contained in … Read more