Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 4 characters in body
Source Link
Brad Dalton
  • 7k
  • 2
  • 36
  • 47

If Post Add Image Before Posts Entry Title Above Content

How to check if post title is located above the content?

I currently using thisThis code to addadds the image above post title, but it is applied abovebefore all post titles of current page located anywhere including the title which are on below the content (iepage.

How do i add one single image before comment list, next previous direction, etc.)the posts entry title?

function abovetitleadt_abovetitle($title){

    //Return new title if called inside loop
    if ( in_the_loop() ) {
    
    $x = do_shortcode('[shortcode id="'. $id . '"]');
        return  $x . $title;    
    
    } else {
    //Else return regular   
    return $title;
    }
}

add_filter( 'the_title', 'adt_abovetitle');

If Post Title Above Content

How to check if post title is located above the content?

I currently using this code to add image above post title, but it is applied above all post titles of current page located anywhere including the title which are on below the content (ie. before comment list, next previous direction, etc.)

function abovetitle($title){

    //Return new title if called inside loop
    if ( in_the_loop() ) {
    
    $x = do_shortcode('[shortcode id="'. $id . '"]');
        return  $x . $title;    
    
    } else {
    //Else return regular   
    return $title;
    }
}

add_filter( 'the_title', 'adt_abovetitle');

Add Image Before Posts Entry Title

This code adds the image before all titles on the page.

How do i add one single image before the posts entry title?

function adt_abovetitle($title){

    //Return new title if called inside loop
    if ( in_the_loop() ) {
    
    $x = do_shortcode('[shortcode id="'. $id . '"]');
        return  $x . $title;    
    
    } else {
    //Else return regular   
    return $title;
    }
}

add_filter( 'the_title', 'adt_abovetitle');
Source Link
Ari
  • 1.2k
  • 1
  • 17
  • 28

If Post Title Above Content

How to check if post title is located above the content?

I currently using this code to add image above post title, but it is applied above all post titles of current page located anywhere including the title which are on below the content (ie. before comment list, next previous direction, etc.)

function abovetitle($title){

    //Return new title if called inside loop
    if ( in_the_loop() ) {
    
    $x = do_shortcode('[shortcode id="'. $id . '"]');
        return  $x . $title;    
    
    } else {
    //Else return regular   
    return $title;
    }
}

add_filter( 'the_title', 'adt_abovetitle');