shortcode not working [closed]

I may have found the problem (from product_attribute) array( ‘per_page’ => ’12’, ‘columns’ => ‘4’, ‘orderby’ => ‘title’, ‘order’ => ‘asc’, ‘attribute’ => ‘asc’, ‘filter’ => ‘asc’ ) [product_attribute attribute=”color” filter=”black”] Notice the attibute is in single quotes wheras yours is in double quotes: do_shortcode (‘[product_attribute attribute=”Grams”]’); also you may need it to be in … Read more

Pros and cons of actions over shortcodes

Neither are correct. Just use show_foo(): <?php echo show_foo(); ?> The only reason to ever use shortcodes is to insert dynamic content into a page or post from within the editor (Although, these days the ‘proper’ way to do that would be with a block, although that’s more difficult). Shortcodes should not be used for … Read more

Can’t seem to get [shortcode]s to work

As Milo indicated: functions.php is a file within your current theme, not the functions.php file in wp-includes. There’s nothing wrong with your code as-is as long as it’s in a file that’s actually being loaded at the correct time. Addressing your other question from the comments, yes, this code can be wrapped up into a … Read more

Nested Shortcode Inside [caption] Doesn’t Process

There is a hook inside the caption shortcode that will allow you to hijack the whole thing. Most of the following is copied from the Core img_caption_shortcode function. function nested_img_caption_shortcode($nada, $attr, $content = null) { extract( shortcode_atts( array( ‘id’ => ”, ‘align’ => ‘alignnone’, ‘width’ => ”, ‘caption’ => ” ), $attr, ‘caption’ ) ); … Read more

How do I add my own custom shortcodes?

Shortcodes work via Shortcode API. Essentially shortcode is just a human-friendly form of writing out data that is processed and passed to associated PHP function. So adding your own shortcode involves: Coding PHP function that would process data, passed by API from shortcode. Registering that function as shortcode handler. I also remember WP Utility Short … Read more

display shortcodes outside of the_content

You can use the function do_shortcode() for use shortcodes outside fomr default content. You can also parse this in your function, there get the output of your textfields, like the follow example for a custom field: if ( get_post_meta( $post->ID, ‘cfield’, TRUE ) ) echo do_shortcode( get_post_meta( $post->ID, ‘cfield’, $single = TRUE ) );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)