Add Media To Library in WordPress Through Code

<?php if (!defined(ABSPATH)) { $pagePath = explode(‘/wp-content/’, dirname(__FILE__)); include_once(str_replace(‘wp-content/’, ”, $pagePath[0] . ‘/wp-load.php’)); } $wordpress_upload_dir = wp_upload_dir(); // $wordpress_upload_dir[‘path’] is the full server path to wp-content/uploads/2017/05, for multisite works good as well // $wordpress_upload_dir[‘url’] the absolute URL to the same folder, actually we do not need it, just to show the link to file $i …

WordPress Query Loop and its Usage

By default WordPress allows you to categorize your content. This functionality is extremely powerful and allows you to have full control of your content. Using this recipe will allow you to find all posts (custom or pages) that are in the same category. This will allow you to build recommended reading sections, customize your archive …