How to add “Shortcode” for WP Contact Form 7?

1. Example :

Copy this code and paste it into your post, page or text widget content.

Error: Contact form not found.

2. Example

Copy Below code in your php file inside where you want put this:
<?php echo do_shortcode( ‘

Error: Contact form not found.

‘ ); ?>

How to call Magento images and Scripts in inside CMS Page?

This is the path of  “{{skin url=” for magento root directory.
1. Example for Images Load :
{{skin url=’images/welcome.jpg’}}

2. Example for Scripts Load :
{{skin url=’js/onLoad.js’}}

3. Example for Direct Scripts Load :
<script type=”text/javascript”>// <![CDATA[
document.write(‘<center><iframe width=”190″ height=”172″ src=”http://www.youtube.com” frameborder=”0″ allowfullscreen></iframe></center>’);
// ]]></script>

How to write first php code?

This is very easy. Just write below code in your php file.

<?php

echo “Welcome New Php Reader”;

?>

Then refersh your server or localhost. There showing  Welcome New Php Reader.

How to Create Php info Page?

Hi, its very easy to create.
1. Just put below code in php file inside

<?php
echo phpinfo();
?>

2. Save file phpinfo.php
3. Upload your server or localhost
4. Run yourdomain/phpinfo.php
5. It’s show your “php info” results.

Allways happy. 🙂

How to view All Categories only in Home from Magento?

<?php $_maincategorylisting=$this->getCurrentCategory()?>
<?php $_categories=$this->getCurrentChildCategories()?>
<!– h2><?php //echo $this->__(‘Browse Products’) ?> </h2 –>
<div>
<ul>
<? foreach ($_categories as $_category):?>
<? if($_category->getIsActive()): ?>
<?php $cur_category=Mage::getModel(‘catalog/category’)->load($_category->getId()); ?>
<?php $layer = Mage::getSingleton(‘catalog/layer’); ?>
<?php $layer->setCurrentCategory($cur_category);
//$this->getCurrentCategory()->getImageUrl()
?>
<? if($_imageUrl=$this->getCurrentCategory()->getThumbnailUrl()):?>
<li> <a href=”<?php echo $this->getCategoryUrl($_category) ?>” title=”<?php echo $this->htmlEscape($_category->getName()) ?>”>
<img src=”<?php echo $_imageUrl ?>” width=”auto” alt=”<?php echo $this->htmlEscape($_category->getName()) ?>” />
</a>
<a href=”<?php echo $this->getCategoryUrl($_category) ?>” title=”<?php echo $this->htmlEscape($_category->getName()) ?>”>
<?php echo $this->htmlEscape($_category->getName()) ?>
</a>
<? if($_description=$this->getCurrentCategory()->getDescription()):?>
<p>
<?php echo $_description ?></p></li>
<?php endif; ?>
<? endif; ?>
<? endif; ?>
<?php endforeach; ?>
<div></div>
</ul>
<div></div>
</div>
<?php $layer->setCurrentCategory($_maincategorylisting); ?>

Just Put your home page or Any Static Page this below Line only :

{{block type=”catalog/navigation” name=”catalog.categories” alias=”all_categories_homepage” template=”catalog/navigation/all_category_view.phtml”}}

Welcome to our other site : www.srinesiga.com

How to Image Rotating in Javascript?

Hi Below I mention full code, Who want this take and enjoy.

Insert the html or php file inside below body tag:

<!– Slider Start –>
<script type=”text/javascript”>// <![CDATA[
document.write(‘<style  type=”text/css” _mce_bogus=”1″> #rotator li { display: none; } </style>’);
// ]]></script>
<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js” type=”text/javascript”></script>
<script src=”your_path/js/rotator.js” type=”text/javascript”></script>
<div id=”rotator_wrapper”>
<ul id=”rotator”>
<!– This type for Magento : “{{skin url=’images/banner/road_cycling_img.jpg’}}” –>
<li id=”photo_1″><img src=”{{skin url=’images/banner/road_cycling_img.jpg’}}” alt=”Photo” /> </li>
<li id=”photo_2″><img src=”your_path/images/banner/road_cycling_img1.jpg” alt=”Photo” /> </li>
<li id=”photo_3″><img src=”{{skin url=’images/banner/road_cycling_img.jpg’}}” alt=”Photo” /> </li>
<li id=”photo_4″><img src=”your_path/images/banner/road_cycling_img1.jpg” alt=”Photo” /> </li>
</ul>
<ul id=”rotator_controls”>
<li><a href=”#photo_1″>1</a> </li>
<li><a href=”#photo_2″>2</a> </li>
<li><a href=”#photo_3″>3</a> </li>
<li><a href=”#photo_4″>4</a> </li>
</ul>
<div>&nbsp;</div>
<div id=”rotator_play_pause_div”><a id=”rotator_play_pause” href=”#”>PAUSE</a></div>
</div>
<!– Slider End –>

And Paste your CSS in your Stylesheet file inside :

/*** Rotator Image Start ***/
/*********** — **********/

/* `Rotator >> `Wrapper
—————————————————————————————————-*/

#rotator_wrapper {
overflow: hidden;
position: relative;
width: 579px;
height: 255px;
margin:0 auto 10px auto;
z-index:100;
}

#rotator_wrapper li {
list-style: none;
}

/* `Rotator
—————————————————————————————————-*/

#rotator,
#rotator li,
#rotator img {
width: 579px;
height: 255px;
}

#rotator {
background: #fff;
position: relative;
}

#rotator li {
position: absolute;
top: 0;
left: 0;
}

/* `Rotator >> `Controls
—————————————————————————————————-*/

#rotator_controls {
overflow: hidden;
position: absolute;
bottom: 10px;
right: 80px;
padding:5px;
}

#rotator_controls li {
display: inline;
float: left;
margin: 0 0 0 5px;
width: 30px;

}

#rotator_play_pause,
#rotator_controls a {
background:#575757;
border: 1px solid #3C3C3C;
color: #fff;
display: block;
font: bold 11px Verdana, sans-serif;
/*padding: 1px 10px 4px;*/
padding:7px;
text-align: center;
text-decoration: none;
}
#rotator_play_pause{
width:54px;
/*padding:1px 0 4px 0;*/
padding:7px 5px;
text-align:center;
}
#rotator_controls a.current {
color: #fff;
text-decoration: none;
background:#1676DF;
border: 1px solid #3C3C3C;
}

#rotator_play_pause:hover,
#rotator_controls a:hover {
background: #1676DF;
border: 1px solid #3C3C3C;
color: #fff;
}

#rotator_play_pause_div {
position: absolute;
bottom: 8px;
right: 10px;
/*padding: 5px 4px 5px 4px;*/
padding:7px 3px;
display: block;
}

/* For IE6. */
* html #rotator_play_pause,
* html #rotator_controls a {
height: 1%;
}

/*********** — **********/
/*** Rotator Image End ***/

And Paste Your Javascript File Inside this :

// Initialize.
var $j = jQuery.noConflict();
function init_rotator() {

// Does element exist?
if (!$j(‘#rotator’).length) {

// If not, exit.
return;
}

// Rotate speed.
var speed = 2000;

// Pause setting.
var pause = false;

// Rotator function.
function rotate(element) {

// Stop, if user has interacted.
if (pause) {
return;
}

// Either the next /first <li>.
var $jnext_li = $j(element).next(‘li’).length ? $j(element).next(‘li’) : $j(‘#rotator li:first’);

// Either next / first control link.
var $jnext_a = $j(‘#rotator_controls a.current’).parent(‘li’).next(‘li’).length ? $j(‘#rotator_controls a.current’).parent(‘li’).next(‘li’).find(‘a’) : $j(‘#rotator_controls a:first’);

// Animate.
$j(‘#rotator_controls a.current’).removeClass(‘current’);
$jnext_a.addClass(‘current’);

// Continue.
function doIt() {
rotate($jnext_li);
}

// Fade out <li>.
$j(element).fadeOut(speed);

// Show next <li>.
$j($jnext_li).fadeIn(speed, function() {

// Slight delay.
setTimeout(doIt, speed);
});
}

// Add click listeners for controls.
$j(‘#rotator_controls a’).click(function() {

// Change button text.
$j(‘#rotator_play_pause’).html(‘PLAY’);

// Show target, hide other <li>.
$j($j(this).attr(‘href’)).show().siblings(‘li’).hide();

// Add and remove from all others.
$j(this).addClass(‘current’).parent(‘li’).siblings(‘li’).find(‘a’).removeClass(‘current’);;

// Pause animation.
pause = true;

// Nofollow.
this.blur();
return false;
});

// Pause / Play the animation.
$j(‘#rotator_play_pause’).click(function() {

// What does the button say?
if ($j(this).html() === ‘PAUSE’) {

// Stop rotation.
pause = true;

// Change the text.
$j(this).html(‘PLAY’);

} else {

// Remove.
pause = false;

// Start the rotation.
rotate(‘#rotator li:visible:first’);

// Change the text.
$j(this).html(‘PAUSE’);
}

this.blur();
return false;
});

// Hide all but first <li>.
$j(‘#rotator li:first’).show();

// Wait for page load.
$j(window).load(function() {

// Begin rotation.
rotate($j(‘#rotator li:visible:first’));
});
}

// Kick things off.
$j(document).ready(function() {
init_rotator();
});

that is all now, you are ready to start your rotating image work.

welcome all :).

How to Define HTML head?

You can Easily create very simple html Tag :

<h1> </h1> — This first Head Tag

<h2> </h2> — This Second Head Tag

<h3> </h3> — This thrid Head Tag

<h4> </h4> — This Fourth Head Tag

<h5> </h5> — This Fivth Head Tag

<h6> </h6> — This Sixth Head Tag

Example :

<h1> :

Example H1

<h2> :

Example H2

<h3> :

Example H3

<h4> :

Example H4

<h5> :

Example H5

<h6> :

Example H6

this is very easy. Enjoy 🙂

How to create future OR Post Thumbnail in WP?

Go to function.php file, Insert Below Code :

// Post thumbnail OR futured Image Set
add_theme_support( ‘post-thumbnails’ );
set_post_thumbnail_size(100, 100, true);

And add below code which you want show the future Image :

<?php the_post_thumbnail(); ?>


Additional Option :

Go to function.php file, Insert Below Code :

add_image_size('loopThumb', 588, 125, true);

OR
<?php the_post_thumbnail('loopThumb', array('class'=>'loopyThumbs')); ?>
OR
add_image_size('squareThumb', 125, 125, true);

OR

if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
set_post_thumbnail_size(588, 250, true); // Normal post thumbnails
add_image_size('loopThumb', 588, 125, true);
}
OR
<?php add_theme_support('post-thumbnails', array('page')); ?>

And add below code which you want show the future Image :

<?php the_post_thumbnail('loopThumb'); ?>

OR

<?php the_post_thumbnail('squareThumb'); ?>
OR
<?php the_post_thumbnail('loopThumb'); ?>
OR
<?php
if (has_post_thumbnail()) {
the_post_thumbnail('loopThumb');
}
elseif (get_post_meta($post->ID, "Thumbnail", true) != '') { ?>
<img src="<?php echo get_post_meta($post->ID, "Thumbnail", true); ?>" alt="<?php the_title(); ?>" class="attachment-loopThumb wp-post-image" />
<?php }
else {
echo '<img src="images/defaultThumbnail.png" alt="Default Post Image" />';
}
?>




How to Redirect Contact form 7 in WP?

Go Contact Form 7 Settings Area?

Add Below Code :
on_sent_ok: “location.replace(‘YOUR URL’);”

OR
Add Message When Sent Successful that message below you can add this :
<script type=”text/javascript”>jQuery(function($){ window.location.href=”your url”; });</script>

what URL you want change there.

that’s all. 🙂

If this is not working, Kindly check google.

thanks.

How to Solve WordPress Error: Warning: Cannot modify header information – headers already sent?

This is mostly white space proble.

1. You go your theme

2. First you check the function.php any unwanted “White Spaces” before <?php OR ?> after.

3. Or header.php before the php tag unwated white space is there. Thta’s most of the problem. so, kindly remove that’s working fine.

I solved this that white space type only.

that’s all 🙂

© 2020 Spirituality