Tuesday, November 10, 2020

Boostrap to Wordpress Convertion notes

 Goto    wp-content/themes


create basic php and css files 




from   index.html

remove title,    copy from top to nav end  --- header.php

foooter to bottom --- footer.php


in between contents to  --- index.php


Functions.php


<?php

function b2w_theme_styles(){
    wp_enqueue_style("boostrap_css"get_template_directory_uri().'/lib/bootstrap/css/bootstrap.min.css');
    wp_enqueue_style("style_css"get_template_directory_uri().'/css/style.css');

}

add_action('wp_enqueue_scripts''b2w_theme_styles');

function b2w_theme_js{
    //wp_enqueue_script("jquery_js", get_template_directory_uri().'/lib/jquery/jquery.min.js');    
    wp_enqueue_script("migrate_js"get_template_directory_uri().'/lib/jquery/jquery-migrate.min.js'array('jquery'),'',true);    
    wp_enqueue_script("popper_js"get_template_directory_uri().'/lib/popper/popper.min.js'array('jquery'),'',true);
    wp_enqueue_script("boostrap_js"get_template_directory_uri().'/lib/bootstrap/js/bootstrap.min.js'array('jquery'),'',true);
 
}

add_action('wp_enqueue_scripts''b2w_theme_js');



?>


replace link src  top   --  header.php

<?php wp_head(); ?>


add in footer.php


  <?php  wp_footer(); ?>



add header, footer to index

 <?php  get_header(); ?>

  <?php  get_footer(); ?>




Make images work

<?php echo get_template_directory_uri(); ?>

style="background-image: url(<?php echo get_template_directory_uri(); ?>/img//intro-bg.jpg)"


Title, dec

<?php bloginfo('name'?>

reference



Post thumbnail feature-- for enabling portfolio like

In functions.php  add   --->  add_theme_support('post-thumbnails');

to enable featured image option





Nav Menu

add_theme_support('menus');







No comments:

Post a Comment