Chitika ad

Sunday, 17 November 2019

How to create your own blogger template in simple stepes for beginners

Blogger Templates must contain following blocks

b:skin section.This is nothing but css style sheet.You can also link css page.But you must have this section
b:section and b:widget.This is a section which is used for adding elements like navbar,adsense,sidebar.Atlease template must have one b:section
b:widget.Elements are called as widgets.It must be placed inside b:section

Simple Blogger Template code

<html>

<head>
  <link href='https://www.w3schools.com/w3css/4/w3.css' rel='stylesheet'/>
  <b:skin></b:skin>
</head>

<body>

<b:section class='header' id='header' maxwidgets='1' showaddelement='no'/>
<b:section class='sidebar' id='sidebar' maxwidgets='' showaddelement='yes'/>

  <b:section class='main' id='main' name='Main' showaddelement='no'>
    <b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'>
    </b:widget>
  </b:section>
<b:section class='footer' id='footer' showaddelement='no'/>


</body>
</html>

How to solve there is no such kind of directory or file in d:\wamp\www\test.txt iwhen including via php

1.Check your path is correct.

2.check your php.ini file settings

3.Goto php.ini file

4.find or search url_encode

5.confirm this settings is on.(allow_url_encode=on)

How to include or add files using php

Php include function

you can include php files in another php by include function
Syntax

<?php include("path") ?>

Example

<?php include("/uploads/sql.php") ?>

How to call an action in wordpress

do_action("function tagname")

Before the action is called,we must define our calling function in functions.php
<?php
function test(){
    echo "<h2>Hellow Function</h2>";
    }
add_action("test",test);
?>

Calling function

do_action("test")

How to insert and execute php code in wordpress platform

Php Everywhere plugin

This plugin used to insert and execute php code in post and pages.Wordpress normally dont execute php code.You can use this via block or shortcode

How to insert short code in wordpress pages and posts

do_shortcode()

This function is used to add shortcodes in post and pages on anywhere.You call it by any no of times you want.

Syntax

do_shortcode("[insertcode]")

Example

<?php echo do_shortcode("[wpdiscuz_comments]"); ?>

what is add_action in wordpress platform

add_action

In Wordpress php functions are seperated and those are defined in seperated file called functions.php.
We can define function as same as our php function
But we need an action tag name for our function
This tag name is used to call function in post or pages in wordpress /p>

<?php
function test(){
    echo "<h2>Hellow Function</h2>";
    }
add_action("test",test);
?>