none

Add this PHP code in functions.php file.   add_filter( ‘the_content’, ‘prefix_insert_post_ads’ ); function prefix_insert_post_ads( $content ) { $ad_code = ‘<div> You can add ads code here </div>’; if ( is_single() && ! is_admin() ) { return prefix_insert_after_paragraph( $ad_code, 1, $content ); } return $content; } // Parent Function that makes the magic happen function prefix_insert_after_paragraph( […]

....Read More
none
none

quick fix, regex | No Comments | July 18th, 2013

include(‘simple_html_dom.php’); function nestedHTML($node) { $doc = $node->ownerDocument; $frag = $doc->createDocumentFragment(); foreach ($node->childNodes as $child) { $frag->appendChild($child->cloneNode(TRUE)); } return $doc->saveXML($frag); } //$html = “<div class=’xyz’><div class=’abc’>contents</div></div>”;  // Add html here libxml_use_internal_errors(true); // if any warning generate $doc = new DOMDocument(); $doc->loadHTML($html); $doc->saveHTML(); $nodes = $doc->getElementsByTagName(‘div’); foreach ($nodes as $node) { $class = $node->getAttribute(‘class’); if($class == ‘entry-content’){ […]

....Read More
none
none

quick fix, wordpress | No Comments | June 12th, 2013

The edit author attribute is not added by default in for custom post types. To add the author attribute the following code is required: please add this code to function.php in theme folder. function allowAuthorEditing() { add_post_type_support( ‘mytype’, ‘author’ ); } add_action(‘init’,'allowAuthorEditing’);

....Read More
none
none

quick fix, wordpress | No Comments | May 23rd, 2013

Please  delete  blank spaces at the top and bottom of functions.php in your theme folder…

....Read More
none
none

Mode rewrite, quick fix | No Comments | April 26th, 2013

open .htaccess file and paste this code on top. <FilesMatch “.*\.(htm|html|php)$”> SetHandler application/x-httpd-php5 </FilesMatch>

....Read More
none
none

wordpress | No Comments | April 22nd, 2013

Add this code to Functions.php file in theme folder. $subRole = get_role( ’subscriber’ ); $subRole->add_cap( ’read_private_posts’ ); $subRole->add_cap( ’read_private_pages’ );   and make post or page in Private mode.

....Read More
none
none

quick fix, wordpress | No Comments | January 31st, 2013

PLease add this code in function.php file from your active Theme folder   function szub_nofollow_tag($text) { return str_replace(‘<a href=’, ‘<a rel=”nofollow” href=’, $text); } add_filter(‘wp_tag_cloud’, ‘szub_nofollow_tag’);   /* Will add no follow in tag Cloud */ add_filter(‘the_tags’, ‘szub_nofollow_tag’); /* Will add no follow in Post Tags */      

....Read More
none