Get the blog page URL set in Options
As of WordPress 4.5 you can use: get_post_type_archive_link( ‘post’ ); This handles the logic of getting the correct URL regardless of whether posts show up on the homepage or in a specified page.
As of WordPress 4.5 you can use: get_post_type_archive_link( ‘post’ ); This handles the logic of getting the correct URL regardless of whether posts show up on the homepage or in a specified page.
get_template_directory_uri() will always return the URI of the current parent theme. To get the child theme URI instead, you need to use get_stylesheet_directory_uri(). You can find these in the documentation, along with a list of other useful functions for getting various theme directory locations. If you prefer to use a constant, then TEMPLATEPATH is akin … Read more
Coming in late to this party, but here’s the “WordPress” way: use plugin_dir_path( __FILE__ ), e.g.: <?php include( plugin_dir_path( __FILE__ ) . ‘ipn/paypal-ipn.php’); ?> Note that the function does return the trailing slash for the filepath.
You can extend the get_the_archive_title filter which I’ve mentioned in this answer add_filter(‘get_the_archive_title’, function ($title) { if (is_category()) { $title = single_cat_title(”, false); } elseif (is_tag()) { $title = single_tag_title(”, false); } elseif (is_author()) { $title=”<span class=”vcard”>” . get_the_author() . ‘</span>’; } elseif (is_tax()) { //for custom post types $title = sprintf(__(‘%1$s’), single_term_title(”, false)); } … Read more
You are asking two questions at once: What’s the difference between home_url() and site_url()? How do I get WordPress to return the URL root without the subdirectory where it’s installed? Here are the answers, and I confirmed with Andrew Nacin, a core developer of WordPress, as well as ran some server tests to confirm what … Read more
The plugins are loaded right before theme (yes, I’ve been looking for excuse to use this): However it is wrong to think about either as point of code execution. For most cases everything should be hooked and executed no earlier than init hook. According to Codex widget registration with register_widget() should be hooked to widget_init. … Read more
Yes, you’ve guessed it right. You will need to use Custom Fields in order to define the URL for the Image that you wish to use as Featured Image for the post. Next part is to tell the WordPress to use the Image from URL you’ve in Custom Field as Featured Image. Here, you can … Read more
Enable Hidden Administration Feature displaying All Site Settings Tested on: WordPress 3.1 RC3 This little piece of code does something pretty cool. It will add an additional option to your settings menu with a link to “all settings” which will show you a complete list of all the settings you have within your database related … Read more