JNestudi
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Custom Post Type Twenty Twelve TemplateThat worked!!! Thanks! ??
Forum: Themes and Templates
In reply to: Custom Post Type Twenty Twelve TemplateNo, just error404 page.
Forum: Plugins
In reply to: Change file on template trough pluginGreat!!! This works!
Thank you!
I made a plugin to can add an image header without modify the theme ’cause it has regulary updates.
Can you correct if my code is not clear (now is working but maynbe isn’t good written :S)
This is the code:add_action( 'loop_start' , 'mh_main_loop_test' ); function mh_main_loop_test($query) { global $mh_loop_count; if ( ( did_action( 'wp_enqueue_scripts' ) == 1 ) and $mh_loop_count == 0 ) { $mh_loop_count++; // do something HERE echo '<!-- JNestudi add Header Plugin START -->'; if (have_posts()) : while (have_posts()) : the_post(); //$img = the_post_thumbnail(); $domsxe = simplexml_load_string(get_the_post_thumbnail()); $thumbnailsrc = $domsxe->attributes()->src; $thumbnailalt = $domsxe->attributes()->title; if(isset($thumbnailsrc)) { ?> <img title="<?php echo $thumbnailalt; ?>" alt="<?php echo $thumbnailalt; ?>" src="<?php bloginfo('url'); ?>/wp-content/plugins/jn_header/timthumb.php?src=<?php echo $thumbnailsrc;?>&h=315&w=1024&zc=1" /> <?php } endwhile; endif; echo '<!-- JNestudi add Header Plugin END -->'; } }
Thank you!
Forum: Plugins
In reply to: Change file on template trough pluginThanks but i need to add some codes into the body,just after the header.php. Is it possible? I see a lot of plugins that push content (like Adds or social sharing) into different parts. I need to push content right after the file header.php of my current template is loaded or instead load my own header (witch will call the header.php file on the current template and then add my codes).
For you can understand better an example: I want to add a
<h1>Hello world!</h1>
right after the header of the template is loaded.Any possibilities?