custom html instead of blog preview image

pending (4 posts) (2 voices)

  1. goldeneye
    Member

    Any chance to inserting custom html like 3 or 4 fancy images instead of one blog preview image?

    Attachments

    1. Beispiel_Custom_Header.jpg (45.5 KB, 0 downloads) 1 year old
    Posted 1 year ago #
  2. Ruderic
    Support

    Hi,

    Inserting HTML code there would be a really complex task. Also, you would need to edit a lot of CSS code in order to make it look good.

    Here I will tell you how to include your own image there, instead of the post thumbnail. Maybe this works for you.

    Go to the theme folder, and open the file "lib/functions/posts.php". In line #36 and #73, you will find this code:

    $meta_image = get_post_meta($post->ID, "post_image", true);

    Replace both of them with:

    $meta_image = get_post_meta($post->ID, 'custom_image', true);

    Now, when you create your posts, you will have to add a custom field to them, called "custom_image" and containing the full URL to your new image.

    Posted 1 year ago #
  3. goldeneye
    Member

    Thank you Ruderic for your quick request. But that is not the solution I was looking for.

    My idea was to create an custom field instead of blog preview image for inserting pure html. For creating a slider instead of blog preview or a few thumbs.

    But thank for your help.

    Posted 1 year ago #
  4. Ruderic
    Support

    Hi,

    If you open that file "lib/functions/posts.php", in lines #53 and #90 you will find this code:

    <img class="framed fade_hover" src="<?php echo $meta_image; ?>" width="126" height="90" alt="<?php echo $post_title; ?>"/><br />

    Replace that code with:

    <?php echo get_post_meta($post->ID, 'custom_html', true); ?>

    Now, create a custom field called "custom_html" in your posts, and insert your HTML code there.

    As I said, you will probably need a lot of CSS tweaks in order to make it look right. If you need help, feel free to ask us any question.

    Posted 1 year ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme