admin menu: use default “general” page for theme settings using add_menu_page and add_submenu_page

You need to create a submenu page with the same slug as the menu page. E.g. $menu_slug = “my_menu_slug”; $desired_capability = “manage_options”; //Or whatever you need $menu_page_callback = “menu_page_callback_function”; add_menu_page( “Page Title”, “Menu Title”, $desired_capability, $menu_slug, $menu_page_callback ); add_submenu_page( $menu_slug, “Submenu Page Title”, “Submenu Menu Title”, $desired_capability, $menu_slug, $menu_page_callback ); //Note, the 5th and 6th … Read more

What’s a good way to default behavior if a plugin is inactive?

How about using the WordPress is_plugin_active() function? – https://codex.wordpress.org/Function_Reference/is_plugin_active This is an admin only function though, so to use it in the frontend or within a template file you would need to manually require plugin.php like so: include_once( ABSPATH . ‘wp-admin/includes/plugin.php’ ); is_plugin_active($plugin); Where $plugin is the name of the plugin sub directory/file eg: is_plugin_active( … Read more

Show multiple option in URL with Redux framework in front end

try to use this: function tes_sidebar() { global $redux_demo; $sidebar =& $redux_demo[‘sidebar_position’] ) ? $redux_demo[‘sidebar_position’] : ‘right’; switch ( $sidebar ) { case ‘left’: get_template_part( ‘sidebar’,’left’ ); break; case ‘disable’: get_template_part( ” ); break; default: get_template_part( ‘sidebar’,’right’ ); break; } } call with this function: tes_sidebar();

using themename_the_custom_logo() in template-tags?

first of all why he did not use the_custom_logo() method itself in the header file This function checks that the the_custom_logo function exists for backwards compatibility, so that the function works on WordPress versions older than 4.5. The reason this is done in inside twentysixteen_the_custom_logo() is so the theme can just use a single function … Read more

How to find php variable of wordpress theme settings

Plugin options are normally stored in the wp_options table. If you look at the plugin code (and reference the Plugin information in Codex; you can start here: https://codex.wordpress.org/Writing_a_Plugin ), you will see how the plugin names the option. Then you can create a function that will change that option value. Note that most plugins store … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)