Efficient way to edit WordPress themes

Delete DreamWeaver right now and do the following instead so that you can edit everything locally and see changes in real-time: 1) Install MAMP so you can run a server locally on your computer and then install WordPress as you normally would but in a local computer folder 2) Download SublimeText as your code editor. … Read more

Customizing default Mediaelement player

Okay so i did manage to add some custom css selectively on pages that load the medialement player by adding this to my functions.php file: function custom_player() { wp_enqueue_style( ‘custom-player’, get_stylesheet_directory_uri() . ‘/wp-mediaelement.css’ ); $custom_css = ” /*here goes the css*/ “; wp_add_inline_style( ‘custom-player’, $custom_css ); } add_action( ‘wp_enqueue_scripts’, ‘custom_player’ ); Like this by using … Read more

Problem adding class to body_class

You are using array_push() incorrectly. Do this: $classes[] = ‘new-class’; Or this: array_push( $classes, ‘new-class’ ); But not: $classes[] = array_push( $classes, ‘new-class’ );

Altering html structure and creating custom menus

Given the amount of customization you’re looking to make, your best bet may be to integrate a custom Walker function. From the Codex: For deeper conditional classes, you’ll need to use a custom walker function (created in the ‘walker’ => new Your_Walker_Function argument). The easiest way to build a new walker function is to copy … Read more

How to make Custom Walker for wp_nav_menu() for materialize framework

I’ve made something like this: <div class=”navbar-fixed”> <nav> <div class=”nav-wrapper”> <a href=”#!” class=”brand-logo”><?php _e(‘Logo’, ‘newborn’); ?></a> <a href=”#” data-activates=”mobile-demo” class=”button-collapse”><i class=”mdi-navigation-menu”></i></a> <ul class=”right hide-on-med-and-down”> <?php wp_nav_menu( array( ‘theme_location’ => ‘primary-menu’ ) ); ?> </ul> <ul class=”side-nav” id=”mobile-demo”> <?php wp_nav_menu( array( ‘theme_location’ => ‘primary-menu’ ) ); ?> </ul> </div> </nav> </div> Plus this css: .menu ul{display: … Read more

Overwrite style.css styles from index.php style

Add this code in your theme’s functions.php add_action(‘wp_footer’, ‘my_home_page_styles’, PHP_INT_MAX); function my_home_page_styles() { if(is_front_page()) { ?> <style> #main { margin-left: 0 !important; } .container { width: 95% !important; } </style> <?php } } Don’t forget to clearing your cache before refreshing. Use Ctrl + F5 to refresh in Google Chrome.

Is there a default style.css

You can certainly use it, but it is not going to cover everything. Plus a lot of the style is going to depend on how you structure your content and other such items like your menus. If you are looking for just a blank stylesheet that contains all the default classes and such that WordPress … Read more

How to add page using HTML, CSS and JS?

You can create custom templates in WordPress defining the template name at the top of the template. This is a basic template that should help you get started. You can save your template with a file name like tmp-mycustomname.php and put it in your theme. You probably should create a child theme where you can … Read more