Articles of wp admin

Custom WP_Query doesn't display all posts

I’m building an options page which allows users to choose three posts and three custom images that display on the site’s front page. I am using the Settings API to create a custom WP_Query which pulls all posts from 4 different CPTs (‘resources’, ‘events’, ‘blog posts’, and ‘publications’), and populates the titles and IDs (hidden) […]

Registering for a domain on WordPress

I have recently started development with wordpress for a project and its wonderful! I am following WordPress Essential training on to help me build a foundation on the subject matter. I have almost completed customizing the website and would now like to register of a domain, but am not sure how to do this. […]

How to add attributes to WordPress Admin Sub Menu List Items

I have been trying to find a way to add a class or an id to my custom administration sub menu. I only see a class on the first menu item. I would either like to add a css class or an ID on my sub menu list items.

Delete the “wp-admin” folder – what could go wrong?

I would like to pass on a website to a client, but he is not paying for the CMS backend. Could I just remove the wp-admin Folder and just use the front-end of wordpress? Could there go something wrong by doing this? Is there a better way of disabling the backend CMS?

Efficient way to check local WordPress php files and Database for malicious code?

This question already has an answer here: Verifying that I have fully removed a WordPress hack? 12 answers

get_total () returns 0 – woocommerce

I have some function to get order total value. I have a problem, because get_total(); allways returns 0. I need order total value from backend admin > order details. When i check files i found some string: $formatted_total and filter for it: Class_WC_Abstract_Order , but i can’t show that price. function suma() { global $wp; […]

Best way to disable sidebars on posts (only)?

I would like to not have the sidebar when rendering individual posts and pages. Having the side bar is fine on category views, start page, etc… I am not developing a theme, I am using an existing theme… thus what I want to avoid is hacking or child-override the template itself: The best I was […]

How to use underscore.js in WordPress Admin

I am trying to use underscore in my WordPress Admin. This is what I have done: I enqueue a script in the very end of the page, like so: function load_admin_scripts() { wp_enqueue_script( “my-admin”, get_template_directory_uri() . “/assets/scripts/admin.js”, array(‘jquery’, ‘wp-util’), null, true ); } add_action(‘admin_enqueue_scripts’, ‘load_admin_scripts’); …then in the script file, I am at the moment […]

Unable to display WordPress admin bar in the frontend as an admin

I’ve inherited a WordPress multisite install. I’m in the process of redesigning several of the subsites and I’ve noticed that WordPress is not displaying the admin bar in the front-end, even as an admin. Initially I thought it was a theme error so I went ahead and changed to a stock WordPress theme such as […]

Prevent add_filter being applied to wp-admin pages

I’m applying a filter to a custom fields plugin. add_filter(‘acf/load_value’, word_swap); My problem is this applies it to pages within the wp-admin also. I only want the filter applied to the actual WP site, and not the admin panel. How can I prevent the filter being applied to the wp-admin pages? I imagine I’d do […]