WP frontend output of custom textarea fields not respecting line breaks. In admin it’s OK

Explode your $options value by “/n” ( new line ), then do a echo in foreach: $options = get_option(‘my_custom_plugin_options’); $textarea = $options[‘my_custom_plugin_options_textarea’]; $lines = explode(“\n”, $textarea); foreach( $lines as $line ){ echo $line; } UPDATE #1 For reference, it’s possible to store this function in functions.php to use later in template files. function the_textarea_value( $textarea … Read more

How do I display two separate taxonomy archives for two post types that share a single taxonomy?

According to the WordPress Codex archive-{post_type}.php So, in your case (depending on your naming): archive-products.php If you have a custom taxonomy archive also, then the challenge is structuring your archive to represent the proper taxonomy template. If you need to have a custom taxonomy archive, I would recommend that you use the post-type archive structure … Read more

Loading partial templates with AJAX/PJAX

If you’re concerned about the performance I would recommend using the WordPress API instead of trying to load markup using ajax. If you look at wp-includes/template-loader.php you can see how WordPress itself figures out which template to use. You could in theory just load that file, but you might have problems with template_redirect. require_once( ABSPATH … Read more

How to control output of custom post type without modifying theme?

There’re two very often forgotten action ref arrays: loop_start/_end(). Just turn on output buffering and you’re ready to go. add_action( ‘loop_start’, ‘wpse75307_plugin_loop’ ); add_action( ‘loop_end’, ‘wpse75307_plugin_loop’ ); /** * Callback function triggered during: * + ‘loop_start’/`have_posts()` after the last post gets rendered * + ‘loop_end’/`the_post()` before the 1st post gets rendered * @param object \WP_Query … Read more

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