Individually styling date month year [closed]

As suggested, you can break down the date format in different parts. echo ‘<span class=”date-day”>’ . get_the_date( ‘d’ ) . ‘</span>’; echo ‘<span class=”date-month”>’ . get_the_date( ‘M’ ) . ‘</span>’; echo ‘<span class=”date-year”>’ . get_the_date( ‘Y’ ) . ‘</span>’; Now each item have class associated with it, so you can style each differently as you … Read more

How does WordPress process plugin installations?

OK, so I think I got everything that is needed. So yes, you could work with a combination of: plugins_api install_plugin_install_status install from an instance of Plugin_Upgrader This may seem elaborate but you can actually see from the WP-CLI project that it is quite straight-forward. Of course, you can just install that excellent plugin and … Read more

Display Password Protected external RSS in wordpress template

I assume you mean fetching an external feed with an HTTP authentication. Fetching feeds with HTTP Authentication Note that fetch_rss() uses the MagPie library, that’s deprecated in WordPress. Use instead fetch_feed() that uses the SimplePie library. It looks though it doesn’t support this kind of url: http://user:[email protected]/feed/ like we can use with curl in command-line, … Read more

Pass info from functions.php to plugin

Plugins are loaded before the theme which means that your apply_filters won’t have any actual callbacks registered to it. Instead, you need to call your apply_filters sometime after the theme has been loaded. Something like this: /* Your plugin’s file: */ add_action( ‘init’, ‘my_lovely_funky_filters’ ); function my_lovely_funky_filters() { /* Fire our callbacks */ $value = … Read more

Ninja form Redirect depending on text field content [closed]

I am not sure whether you have hooked this function to appropriate action. Also you have not concatenated the strings properly: Instead of $newdestinationurl = $url/$destinationurlslug ; it should be $newdestinationurl = $url.”https://wordpress.stackexchange.com/”.$destinationurlslug ; Please see below for the complete code: function ninja_forms_handler() { add_action ( ‘ninja_forms_post_process’, ‘change_ninja_forms_landing_page’, 1, 2 ); } add_action(‘init’, ‘ninja_forms_handler’); function … Read more

str_replace function in theme

function replace_content($text) { $replace = array( ‘Check’ => ‘<span style=”color:red”>Check</span>’, ‘Map’ => ‘<span style=”color:red”>Map</span>’, ‘Comments’ => ‘<span style=”color:red”>Comments</span>’, ‘Print’ => ‘<span style=”color:red”>Print</span>’ ); $text = str_replace(array_keys($replace), $replace, $text); return $text; } add_filter(‘the_content’,’replace_content’);