Forum Replies Created

Viewing 3 replies - 16 through 18 (of 18 total)
  • what about this

    you replace the output to just have the video id.

    // delete youtube from output
    str_replace("youtube","",$yourOutputShownOnYourSide);
    
    // you will get something like "[ yu44JRTIxSQ]"
    str_replace("[","",$yourOutputShownOnYourSide);
    
    // you will get something like " yu44JRTIxSQ]"
    str_replace("]","",$yourOutputShownOnYourSide);
    
    // you will get something like " yu44JRTIxSQ"
    trim($yourOutputShownOnYourSide);
    
    // you will get something like "yu44JRTIxSQ"

    than you can create a link to that video or embed the vid
    for link:

    // echo link
    echo "https://www.youtube.com/watch?v=".$yourOutputShownOnYourSide;
    
    // echo embed
    echo "<iframe class=\"youtube-player\" type=\"text/html\" width=\"640\" height=\"385\" src=\"https://www.youtube.com/embed/".$yourOutputShownOnYourSide."\" frameborder=\"0\">
    </iframe>";

    (not tested the code)

    Forum: Hacks
    In reply to: category image

    what about this:

    <?php
    if ( is_category( 'wordpress' ) ) {
    $imagePath = 'pathToWorpressImage.png';
    }
    ?>
    <img src="<?php echo §imagePath;?>" ...>

    you could create a category array with wp_list_categories(); and identify with is_category(); in which category you are and generate a $imagePath you want to display belonging to the different categories.

    Thread Starter ysr5

    (@ysr5)

    nobody? ??

Viewing 3 replies - 16 through 18 (of 18 total)