Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter JNestudi

    (@jnestudi)

    That worked!!! Thanks! ??

    Thread Starter JNestudi

    (@jnestudi)

    No, just error404 page.

    Thread Starter JNestudi

    (@jnestudi)

    Great!!! 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!

    Thread Starter JNestudi

    (@jnestudi)

    Thanks 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?

Viewing 4 replies - 1 through 4 (of 4 total)