HOME / BLOG

How to create custome tempate in worpdress?

Create custome tempate in worpdress <?php /* Template Name: my_first_custom_template*/ ?> <?php get_header(); ?> <div id=”primary” class=”content-area”> <main id=”main” class=”site-main” role=”main”> <?php // Start the loop. while ( have_posts() ) : the_post(); // Include the page content template. get_template_part( ‘template-parts/content’, ‘page’ ); // If comments are open or we have at least one comment, load […]

How to create header and footer in wordpress?

create header and footer in wordpress HomeHow to create header and footer in wordpress? How to create header and footer in wordpress? Developer’s BlogThursday, January 02, 2020 create header and footer in wordpress Header function sandeep_code_just_after_body(){ echo “<div class=’top-header’>”.get_bloginfo(‘name’).”</div>”; } add_action(“wp_head”,”sandeep_code_just_after_body”); Footer function sandeep_code_for_footer(){ echo “<div class=’main-footer’></div>”; } add_action(“wp_footer”,”sandeep_code_for_footer”);  

How to create custom post menu in wordpress?

Create custom post menu in wordpress function my_ebooks() { $labels = array( ‘name’ => _x( ‘Ebooks’, ‘Post Type General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘Ebook’, ‘Post Type Singular Name’, ‘text_domain’ ), ‘menu_name’ => __( ‘Ebooks’, ‘text_domain’ ), ‘name_admin_bar’ => __( ‘ebook’, ‘text_domain’ ), ‘archives’ => __( ‘Item Archives’, ‘text_domain’ ), ‘attributes’ => __( ‘Item […]

How To Create A plugin In wordpress?

Create A plugin In WordPress Paste this code in the php file with the same name of your plugin folder <?php /* Plugin Name: My First Plugin Description: This is my first plugin in wordpress. version: 1.0 Plugin URI: https://amitpalsingh.com Author: Sandip Das Author URI: https://amitpalsingh.com */ ?>  

How to create a table with wordpress custom plugin?

Create a table with WordPress custom plugin <?php function my_first_plugin_code(){ /* create table */ global $wpdb; $charset_collate = $wpdb->get_charset_collate(); $table_name = $wpdb->prefix . “myplugintable”; $sql = “CREATE TABLE $table_name ( id mediumint(9) NOT NULL AUTO_INCREMENT, time datetime DEFAULT ‘0000-00-00 00:00:00’ NOT NULL, name tinytext NOT NULL, text text NOT NULL, url varchar(55) DEFAULT ” NOT […]

Can I override the values loaded by add_theme_support in function.php?

Problem: I’m setting up a site based on the Twenty Seventeen theme and that theme includes in its function.php file a section to set the size of the custom-logo: //code add_theme_support( ‘custom-logo’, array( ‘width’ => 250, ‘height’ => 250, ‘flex-width’ => true, ) ); The site’s logo is 946 wide by 250 high. It is […]