Tag Info

Hot answers tagged

3

The last line tells WP to run this function on the pre_get_posts hook. That hook is the ideal place to modify the main query that will be run in order to build the page. In this case, exclude_featured_tag() checks whether WP is loading the home page, and whether it's about to call the main query for the page (as opposed to any other secondary queries being ...


3

First, like many things in WordPress, it's not like someone decided "let's make this neat and convenient". It was more like someone slapped it together for something, then it got used more in admin, then it got used a lot in admin, then it became kind of practice to use it for non-admin as well. Or something along these lines. Second, it's not as much what ...


1

The requires are just echoing the content, you need to put ob_start(); before the if ($query->have_posts()) :, and return ob_get_clean(); after the endif;.


1

For reference, you may want to read the update_option documentation. The arguments you are passing are completely unrelated. However, your third technique is the closest, you have to update all the options in the the update_option call, not just the one option you want. This is because of how the plugin is storing it's options as an array rather than ...


1

I think the path to the image is wrong, use get_stylesheet_directory_uri() to retrieve the style.css path. If this isn't it let me know and I will take a closer look. I just dug out an example which worked for me in the past: function my_login_logo() { ?> <style type="text/css"> body.login div#login h1 a { background-image: ...



Only top voted, non community-wiki answers of a minimum length are eligible