500 (Internal Server Error) of external php file
500 (Internal Server Error) of external php file
500 (Internal Server Error) of external php file
Add a conditional to the existing if-statement checking for is_front_page() (or is_home(), depending on your needs): if ( ! empty( $image ) && is_front_page() ) {
Here is the solution I came up with using options. Thanks for the advice this worked well for my use case. <?php // This function sends the http request that purges my cdn cache. function hw_cdn_purge() { // My http request code goes here. // After the request the purgeCdnResult variable is set to the … Read more
It’s just that you got it a bit wrong – it’s actually if(is_single()) (not singular). If you want to address pages in general (not posts I assume), you would use if(is_page()) . If you need to address a specific page you could use its ID like so if(is_page(13)) where 13 would be the ID of … Read more
I think that when you are filtering, you are using an onpage action that hides what is not on the category clicked (done with JavaScript, usually with jQuery), and when you go to another page, you are getting a new page from the server, so your filter disappear. I think that this behaviour is ok, … Read more
According to the get_post_meta() function reference in the WordPress Codex, “If there is nothing to return the function will return an empty array unless $single has been set to true, in which case an empty string is returned.” That means we can use ternary operators to check whether get_post_meta() returns an empty string, and if … Read more
Some of the code you have in here is really outdated and has been deprecated for quite some time. I am going to use updated code so that it’s more useful to those who will stumble on this thread. <div class=”news_item”> <?php $posts = get_posts( ‘numberposts=2&order=DESC&orderby=post_title&category_name=news’ ); foreach ( $posts as $post ) : setup_postdata($post); … Read more
You could use wp_schedule_event to schedule recurring tasks. The smallest precision it normally supports is “hourly” but you can use wp_get_schedules to create a custom “ten_minutes” interval. Or, you could use wp_schedule_single_event to just trigger the event once and have that scheduled task schedule the next event ten minutes later.
I think you should use post-thumbnails In your functions.php file This function will give you access to add image on each post you want to add am image //And post featured images function add_featured_image(){ add_theme_support(‘post-thumbnails’); } add_action(“after_setup_theme”, “add_featured_image”); After adding that function in your functions.php, now you can access the functionality in admin dashboard. By … Read more
For a quick solution you can download the WordPress plugin photo-gallery https://wordpress.org/plugins/photo-gallery/. Once it’s installed and activated you hover your mouse over Photo Gallery in your WordPress Dashboard and click Add Galleries/images. Add a new picture or many pictures in a new gallery and save. When it’s done simply hover your mouse over Photo Gallery … Read more