PHP Notice: Undefined offset: 0

I have errors in WordPress: PHP Notice: Undefined offset: 0 in /home/userpro/public_html/wp-content/themes/hoon/inc/tweaks.php on line 602 PHP Notice: Trying to get property of non-object in /home/userpro/public_html/wp-content/themes/hoon/inc/tweaks.php on line 602 Code: /** * Display Future Posts * * Display future post in the events category to all users. */ function hoon_show_all_future_posts( $posts ) { global $wp_query, $wpdb; if ( is_single() && $wp_query->post_count == 0 ) { $events_cat = hoon_option( ‘events_category’ ); $request = $wpdb->get_results( $wp_query->request ); /* Line 602 bellow */ if ( post_is_in_descendant_category( $events_cat, $request[0]->ID ) || in_category( $events_cat, $request[0]->ID )…

The Battle Royale: Atom vs. Sublime

For most developers, text editors are just as sacred as discussing the proper way to say “gif.” Sublime Text has been the heavy hitter for some time and for good reason. As an avid Sublime user I decided to see where Atom stood since I last looked; the time of early beta stages. What follows is my experience during a period of five days using the Open Source code editor from GitHub told through the perspective of a seasoned Sublime user. Atom I’d like to begin by addressing a few…

How to get the last term from taxonomy?

working on a scholar journal in which publisher add issues to the « issue » taxonomy assigned with articles. i need to display outside the loop a list of posts assigned only with the last issue (recently added). any help please? update: i found a code to get the last term from a taxonomy: $issue = get_terms(‘issue’,’orderby=none&order=DESC&number=1′); $current_issue = $issue[0]->slug; But i couldn’t find a way to use it to display a list of posts assigned only with that last term. any suggestions please? Source: https://wordpress.stackexchange.com/feeds

Issue with wp_handle_upload

I am trying to upload a zip file from Setting Page. I have designed a setting page and in that I have a file upload functionality. I am using setting API to do this. My issue is: I know that maximum upload size is 8MB by default. When I am trying to upload file less that 8MB, it is working fine. But when any file more that 8MB is uploaded, I am redirected to option.php page. I just want to handle this type of issue but I am unable to.…

Web Design Weekly #196

Headlines Web Design – The First 100 Years A fascinating read by Maciej Cegłowski (who is the creator of Pinboard) that aims to persuade you that the same thing that happened to aviation is happening with the Internet. Make time for this. (idlewords.com) The Web’s Cruft Problem (telerik.com) Discover how to make your UI better to get more conversions Are you looking to create a better user experience on your website? Start using Ptengine and getting problems fixed by truly understanding visitor behaviors with real-time data. Get the Enterprise Plan…

How to show posts only for the last subcategory?

I have a hierarchical categories tree, meaning up to 3-4 subcategories with posts. When clicking on a category link in the home page, I am redirected to the category page. I need to check if there are no subcategories for the current category, then show posts, BUT if there are subcategories, then show only subcategories titles and descriptions with no posts at all. Next, if I click on a subcategory title, check again if there are child categories to that subcategory. If there are, show the titles and descriptions; if…

post visibility history

Revisions show past versions of the article/page but is there a way of seeing the Visibility status historically? User A publishes User B edits the published page changing the visibility to something like private Is this reflected anywhere in the history/revisions? Source: https://wordpress.stackexchange.com/feeds

Pagination of custom post type leads to 404 error

This seems to be common issue, and there exist a lot of posts about this issue but none of them works for me. I have a custom post type (portfolio) with a page pagination. $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; echo ‘<a href= »‘.get_pagenum_link($paged+1).' »>Next Page</a>’; When Set the permalinks settings to ‘Default’ it works fine. mysite.com/?page_id=111&paged=2 When Set the permalinks to any custom structure it leads to the 404 page. mysite.com/portfolio/page/2/ This is driving me crazy. Can’t find any solution. I don’t have a page or post which have the…

Creating Better CSS

For most web developers we are knee deep in CSS on a daily basis. This can be a good or bad thing. It really depends on the state of the CSS. A well-organised codebase can be a pleasure to work with but, generally speaking, most CSS is a complete nightmare, especially on larger projects. Good CSS requires a good foundation, some well thought-out coding principles and a selection of tools to keep you on the right track. Each team, individual and project goals are different so the resources below may…

Post Pagination in WordPress

Setting up post pagination in older versions of WordPress was a little tricky and more often than not required the use of a plugin. Thankfully since WordPress 4.1 a new function is available for displaying pagination with ease. To output post pagination in your theme just using the following function: <?php the_posts_pagination(); ?> The above function also can take 3 arguments if you would like to customise things a little more. <?php the_posts_pagination( array( ‘prev_text’ => __( ‘Back’, ‘your_text_domain’ ), ‘next_text’ => __( ‘More Posts’, ‘your_text_domain’ ), ‘screen_reader_text’ => __(…