• Hi;

    Can anyone advise how I can edit the css to get the full content to show of a sticky post on the home page

    I have created a route map which I want to show at the top of my home page before most recent posts, but it’s currently only showing title and comments

    Thanks
    Tanya

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi Tanya,

    I hope you are well today and thank you for your question.

    Could you please share me your site URL so that i can help you?

    Kind Regards,
    Movin

    Thread Starter tanyakorteling

    (@tanyakorteling)

    Hi;

    Thanks for your reply.

    It’s http://www.cantravelwilltravel.com.

    Whilst you’re in there do you also know how to add a colour coded legend to the map so I can show blue route as planned, and red route as past (or similar) please?

    Thanks
    Tanya

    Hi Tanya,

    You will have to develop custom code to achieve this. You can refer the instructions provided in the following topic to achieve this.

    https://colorlib.com/wp/forums/topic/full-length-post-in-first-page-post/#post-13995

    Whilst you’re in there do you also know how to add a colour coded legend to the map so I can show blue route as planned, and red route as past (or similar) please?

    To achieve this you have to develop more custom code but it is beyond the scope of support that we provide here.

    Best Regards,
    Movin

    Thread Starter tanyakorteling

    (@tanyakorteling)

    Hi;

    I’ve tried to do this but it doesn’t work. It errors. The error says:

    “The http://www.cantravelwilltravel.com page isn’t working

    http://www.cantravelwilltravel.com is currently unable to handle this request.
    HTTP ERROR 500″

    Please can you advise do I just cut and paste the code suggested UNDER what is already in the functions.php or do I overwrite it completely? The current code showing is:

    <?php
    /*
    * Custom functions that overwrites original Travelify functionality
    */
    add_action( ‘wp_enqueue_scripts’, ‘travelify_enqueue_styles’ );
    function travelify_enqueue_styles() {
    wp_enqueue_style( ‘travelify-parent-style’, get_template_directory_uri() . ‘/style.css’ );

    }

    ?>

    Any help on this would be greatly appreciated please!

    Thanks
    Tanya

    Thread Starter tanyakorteling

    (@tanyakorteling)

    Hi;

    Can anyone help me to resolve the above please. Since I followed the instructions above I have been unable to access my wesbite at all. The screen is just white with the internal error 500.

    So I can’t even access the admin to reverse the changes I made which were to install a child theme and amend the php file as recommended to show the sticky.

    I really hope someone can help please as worried I won’t be able to get any of it back again!

    Thanks
    Tanya

    Please try removing the following closing tag from the functions.php file of your child theme

    ?>

    And then add the shared code at the end of functions.php file without overwriting the existing code.

    Thread Starter tanyakorteling

    (@tanyakorteling)

    Hi;

    Thanks for your reply but the problem is I can no longer
    even get into my website to amend the functions.php
    file. I’m just getting the white screen with internal 500
    error.

    Assume this has been caused when I amended the functions.php file. Do you have any idea how to resolve this please?

    Thanks
    Tanya

    Thread Starter tanyakorteling

    (@tanyakorteling)

    Hi Free WP TP;

    I’ve managed to regain access to my website by reverting the functions.php file to it’s original code via my host.

    I’ve now tried what you suggested above (removing the closing tag). However the full route map is still not showing.

    The exact code that is now there is as follows:

    <?php
    /*
    * Custom functions that overwrites original Travelify functionality
    */
    add_action( ‘wp_enqueue_scripts’, ‘travelify_enqueue_styles’ );
    function travelify_enqueue_styles() {
    wp_enqueue_style( ‘travelify-parent-style’, get_template_directory_uri() . ‘/style.css’ );

    }

    /****************************************************************************************/

    if ( ! function_exists( ‘travelify_theloop_for_template_blog_image_large’ ) ) :
    /**
    * Fuction to show the content of page template blog image large content.
    */
    function travelify_theloop_for_template_blog_image_large() {
    global $post;

    global $wp_query, $paged;
    if( get_query_var( ‘paged’ ) ) {
    $paged = get_query_var( ‘paged’ );
    }
    elseif( get_query_var( ‘page’ ) ) {
    $paged = get_query_var( ‘page’ );
    }
    else {
    $paged = 1;
    }
    $blog_query = new WP_Query( array( ‘post_type’ => ‘post’, ‘paged’ => $paged ) );
    $temp_query = $wp_query;
    $wp_query = null;
    $wp_query = $blog_query;

    if( $blog_query->have_posts() ) {
    $counter = 1;
    while( $blog_query->have_posts() ) {
    $blog_query->the_post();

    do_action( ‘travelify_before_post’ );
    ?>
    <section id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <article>

    <?php do_action( ‘travelify_before_post_header’ ); ?>

    <?php do_action( ‘travelify_after_post_header’ ); ?>

    <?php do_action( ‘travelify_before_post_content’ ); ?>

    <?php
    if( has_post_thumbnail() ) {
    $image = ”;
    $title_attribute = apply_filters( ‘the_title’, get_the_title( $post->ID ) );
    $image .= ‘<figure class=”post-featured-image”>’;
    $image .= ‘‘;
    $image .= get_the_post_thumbnail( $post->ID, ‘featured’, array( ‘title’ => esc_attr( $title_attribute ), ‘alt’ => esc_attr( $title_attribute ) ) ).’
    ‘;
    $image .= ‘</figure>’;

    echo $image;
    }
    ?>
    <header class=”entry-header”>
    <h2 class=”entry-title”>
    ” title=”<?php the_title_attribute();?>”><?php the_title(); ?>
    </h2><!– .entry-title –>
    </header>
    <div class=”entry-content clearfix”>
    <?php
    if ( $counter === 1 ) {
    the_content();
    } else {
    the_excerpt();
    }
    $counter++;
    ?>
    </div>

    <?php do_action( ‘travelify_after_post_content’ ); ?>

    <?php do_action( ‘travelify_before_post_meta’ ); ?>

    <div class=”entry-meta-bar clearfix”>
    <div class=”entry-meta”>
    <span class=”author”>“><?php the_author(); ?></span>
    <span class=”date”>” title=”<?php echo esc_attr( get_the_time() ); ?>”><?php the_time( get_option( ‘date_format’ ) ); ?></span>
    <?php if( has_category() ) { ?>
    <span class=”category”><?php the_category(‘, ‘); ?></span>
    <?php } ?>
    <?php if ( comments_open() ) { ?>
    <span class=”comments”><?php comments_popup_link( __( ‘No Comments’, ‘travelify’ ), __( ‘1 Comment’, ‘travelify’ ), __( ‘% Comments’, ‘travelify’ ), ”, __( ‘Comments Off’, ‘travelify’ ) ); ?></span>
    <?php } ?>
    </div><!– .entry-meta –>
    <?php
    echo ‘‘.__( ‘Read more’, ‘travelify’ ).’‘;
    ?>
    </div>

    <?php do_action( ‘travelify_after_post_meta’ ); ?>

    </article>
    </section>
    <?php
    do_action( ‘travelify_after_post’ );

    }
    if ( function_exists(‘wp_pagenavi’ ) ) {
    wp_pagenavi();
    }
    else {
    if ( $wp_query->max_num_pages > 1 ) {
    ?>
    <ul class=”default-wp-page clearfix”>
    <li class=”previous”><?php next_posts_link( __( ‘« Previous’, ‘travelify’ ), $wp_query->max_num_pages ); ?>
    <li class=”next”><?php previous_posts_link( __( ‘Next »’, ‘travelify’ ), $wp_query->max_num_pages ); ?>

    <?php
    }
    }
    }
    else {
    ?>
    <h1 class=”entry-title”><?php _e( ‘No Posts Found.’, ‘travelify’ ); ?></h1>
    <?php
    }
    $wp_query = $temp_query;
    wp_reset_postdata();
    }
    endif;

    /***********************************************************

    Do I need to change something else in the code in order to get this to work please?

    Thanks
    Tanya

    As said previously that you will have to develop custom code to achieve this and the code shared in the posted topic is only for reference purpose.

    Developing custom code for custom functionality is beyond the scope of support that we provide here.

    If you are not a developer then you can consider hiring a developer to develop it for you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to show full content of a sticky post on home page’ is closed to new replies.