Show hyperlinks only when user is loggedin

you can use the_content filter hook to replace the hyperlink with login url. following snippet should do the trick. Update: this function should check if the user is logged in or not (my bad i forgot to add that) add_action( “the_content”, “restrict_url_in_post_content” ); function restrict_url_in_post_content() { $loginUrl = sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/251965/%s” class=”some-class”>%s</a>’, wp_login_url( get_the_permalink() ), … Read more

speed up pagination for huge database

The article on wordpress is interesting and true but I’m not sure what’s it’s purpose. The provided code is for cases when you want to do some action for every post ; it doesn’t help with the pagination on site directly. You may try https://wpartisan.me/tutorials/wordpress-database-queries-speed-sql_calc_found_rows instead, but with million posts, even better would be to … Read more

Problems clearing cache

After more than a half of a day of battle, I found out that style.css has to be in direct subdirectory of a child theme. I had placed it under the /css/ folder together with other styles. That’s why WordPress couldn’t find PHP files… Weird thing is that this folder structure has worked when I … Read more

What is it and from where it is loaded?

This is from a dynamic hook that’s generated in the wp-admin/admin.php file and fires right after the admin_init action. Here’s the inline documentation for the core screens part: /** * Fires before a particular screen is loaded. * * The load-* hook fires in a number of contexts. This hook is for core screens. * … Read more

Changing an image in header.php

Yes it is. You have 2 choices: Option 1 Use an FTP manager such as FileZilla, and navigate to the following folder: \wp-content\themes\YOUR-THEME’S-NAME\images\ and replace the logo.png file with any image you desire. To preserve the appearance, use an image with the same size of your current logo. Option 2 Upload your logo through media … Read more