WordPress security issue to output data from user input from theme option form

Security issues arise when you write code that open up possibilities for outsiders to access your database or otherwise compromise your installation. The above code just reads options and content from the database and translates this into static html that will be send to the browser of the page’s visitor. There’s no code (like a … Read more

Weekly background code not working

In this scenario, the tag that you want to call to execute your function is the wp_head(). Looking at the code you provides, you have the idea down, but I decided to rewrite it differently. In your child theme’s functions.php file, add the following: add_action( ‘wp_head’, ‘wpse_238911_weekly_background’ ); function wpse_238911_weekly_background() { $day = date( “l” … Read more

Can I individually style items in the backend widget list?

Just as @MarkKaplun mentioned in a comment, it’s possible with CSS. Also with Javascript. CSS Approach Let’s look at the Calendar widget, as an example. The id for the widget, in the available widgets list, is of the form: widget-{integer}_calendar-__i__ and in the sidebar it’s: widget-{integer}_calendar-{integer} If we want to display the calendar dashicon before … Read more

how to change a theme slug

For a theme name Hello World a search and replace should be done in phases. Make sure you do a case sensitive search and replace. Replace Hello World with Example Name Replace hello-world with example-name Replace hello_world with example_name Modify theme folder name Look for any other namespaces that the theme uses and replace accordingly. … Read more

menu behavior is not as expected

First thing i would do is register 2 menus, <?php function register_my_menus() {register_nav_menus(array(‘primary’ => __( ‘Primary Menu’ ),’topnav’ => __( ‘Top Nav Menu’ ) ) ); } add_action( ‘init’, ‘register_my_menus’ ); ?> second in wordpress menu panel i would create two menus and assign each to a display location Third i would display the menus … Read more