Add a role and give admin priviledges

I am creating a Super Admin role in wordpress Roles. $capabilities=array(); add_role(‘Administrator’, ‘Administrator’, $capabilities ); add_role(‘Super Admin’, ‘Super Admin’, $capabilities) ); So while adding a new user I got the Role Option Super Admin. So I added a Super User . Now When I login to wp-admin It gives me error saying: you do not have sufficient permissions to access this page. What more I have to do to make it work. I dont want to use any pluggin. I tried this too add_role(‘Super Admin’, ‘Super Admin’, array(« manage_network », »manage_sites », »manage_network_users », « manage_network_plugins », »manage_network_themes », »manage_network_options », « read »)…

Attachment Page Permalink/URL Rewrite Issue. How to change the actual rewriting?

I have a problem understanding the behavior of the Attachment Page Permalinks Into Setting–>Permalinks I have set http://www.example.com/sample-post/ as the preferred setting. When I upload an image a permalink for the Attachment Page is automatically created. Example: I’m into Service (a page) and I upload landscape.jpg to the media gallery. The permalink http://www.example.com/services/landscape/ is automatically created If I want to create a page at named landscape with services as parent I can’t When i create the page Landscape wordpress rename it example.com/services/landscape-2/ Is there a way to modify the way…

Deleted Page Still In WordPress Database

After permanent trashing/deleting a previous page with the same permalink, I still can’t make a page save its permalink without the « -2 » added to the end. How should I solve this problem? Choosing « Quick edit » and change the slug and save will not change the permanent link too. I’m not familiar with WordPress coding or working with database inside phpmyAdmin. If I have to deal with changing SQL, please advice me in steps and easy way. Thank you in advance. Source: https://wordpress.stackexchange.com/feeds

Web Design Weekly #245

Headlines Strategies for Healthier Dev A very good reminder for us to take care of our health so that we can continue to write great code and build cool products for decades to come. (alistapart.com) ​Don’t Get Frustrated – Get Hired ​Sick of pushy recruiters, and dead end interviews? Try Hired to hear from top tier companies, and get truly personalized career support from our Talent Advocates, so that you only talk to relevant companies. Over 4,000+ companies are looking for their next team member on Hired, could that be you?…

How can I get a list of all enqueued scripts and styles?

I’m creating a plugin and I want to get the list of all scripts and CSS used by other plugins. This is my function: function crunchify_print_scripts_styles() { $result = []; $result[‘scripts’] = []; $result[‘styles’] = []; // Print all loaded Scripts global $wp_scripts; foreach( $wp_scripts->queue as $script ) : $result[‘scripts’][] = $wp_scripts->registered[$script]->src . « ; »; endforeach; // Print all loaded Styles (CSS) global $wp_styles; foreach( $wp_styles->queue as $style ) : $result[‘styles’][] = $wp_styles->registered[$style]->src . « ; »; endforeach; return $result; } add_action( ‘wp_enqueue_scripts’, ‘crunchify_print_scripts_styles’); I want to get the returned value inside a…

How to use force_feed with fetch_feed

I use the exact same code from WordPress codex here : https://codex.wordpress.org/Function_Reference/fetch_feed#Example It works as intended with most external RSS i tried to use but for one of them i have the error A feed could not be found at RSS-URL. A feed with an invalid mime type may fall victim to this error, or SimplePie was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed. I can’t find any information on how to use force_feed with the code $rss = fetch_feed(‘RSS-URL’);, and…

Web Design Weekly #244

Headlines A Front End Developer is Aware Chris Coyier shares his insights into why front end developers need to be aware of a whole range of things, like design, performance and the back end, to get the job done better. A great post. (css-tricks.com) The History of the URL: Domain, Protocol and Port (eager.io) Articles A Comprehensive Guide to Font Loading Strategies This one by font loading guru, Zach Leatherman, offloads copious amounts of knowledge about ways to load fonts in today’s web world. (zachleat.com) Front End Development in an…

Pagination Using ajax

I want to use Pagination using ajax for custom post taxonomy. Many of codes are tried by me but at the last I was failed. So,how can i use pagination using ajax without plugin? When i am clicking on load more button then the post will load on the same page. post name:- project taxonomy name:- framework functions.php function wp_pagination() { global $wp_query; $big = 12345678; $page_format = paginate_links(array( ‘base’ => str_replace($big, ‘%#%’, esc_url(get_pagenum_link($big))), ‘format’ => ‘?paged=%#%’, ‘current’ => max(1, get_query_var(‘paged’)), ‘total’ => $wp_query->max_num_pages, ‘type’ => ‘array’ )); if (is_array($page_format))…

WP_LIST_TABLE bulk action

I created a class extend WP_List_Table and created method for bulk actions like this : function get_bulk_actions() { $actions = array( ‘synchronize’ => ‘Synchronize’, ‘delete’ => ‘Delete from Shareino’, ); return $actions; } and another method for processing their : function process_bulk_action() { //Detect when a bulk action is being triggered… if (‘delete’ === $this->current_action()) { wp_die(‘Items deleted (or they would be if we had items to delete)!’); } } This action’s display in a dropbox but when i select items and one of action and press on apply it…

Remove HTTP: from the site URL and just keep // in it

I am building a website for my company which loads over HTTP inside the company and over HTTPS outside company’s network. This is a compulsion and there is no way we can avoid it. The site needs to work over both HTTP and HTTPS. This mixed HTTP & HTTPS is giving a huge problem to us. I tried using plugins which make the URLs relative. But some URLs are still absolute and the admin panel doesn’t open properly over HTTPS. Is there any hack using which we can remove HTTP…