Home Forums Free Themes Education Hub Bullet point list & bolding on home page

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #8880
    cakeeater34
    Participant

    Can someone please advise on how I can format the home page to have a bullet point list as well as some text being bold.

    Need it to be like:

    Cars (Running or Not)
    • Motorcycles
    • ATVs\Snowmobiles
    • RVs
    • Boats
    • Planes and many more!

    rather than how it appears now of:

    Cars (Running or Not) • Motorcycles • ATVs\Snowmobiles • RVs • Boats • Planes and many more!

    They are styled properly on their respective pages, but when it feeds to the home page it does not keep the formatting.

    THANKS!

    #8884
    wensolutions
    Keymaster

    Hello,

    Can we have your better site URL so that we can monitor your issues better?

    Waiting for your reply

    Best regards

    #8885
    cakeeater34
    Participant

    http://www.vehicledonationstation.com/

    Thanks for the prompt response!

    #8893
    wensolutions
    Keymaster

    Hello,

    It seems like you have not added any bullets from the page editor on

    Dashboard => Pages => All pages => Edit page (Your home page)

    Have you tried adding bullets from the text editor?

    Please try it and tell us how it goes.

    Best regards.

    #8909
    cakeeater34
    Participant

    The home page is setup as a static page, and feeds in feature pages – on that particular feature page, the bullets are there, but don’t carry the formatting over to the homepage.

    #8912
    wensolutions
    Keymaster

    Hello,

    Sorry that we did not understand your issue earlier but now we have and what we also have is a solution for you.

    For that you will be needing to create a child theme for the parent theme, You can create it manually or you can use the help any child theme creating plugins. Here is the link for one of the plugin.
    https://wordpress.org/plugins/one-click-child-theme/

    After that on your child theme’s function.php paste the below given code.

    function education_hub_get_featured_content_details( $input ) {
    
    $featured_content_type   = education_hub_get_option( 'featured_content_type' );
    $featured_content_number = education_hub_get_option( 'featured_content_number' );
    
    switch ( $featured_content_type ) {
    
    case 'featured-page':
    
    $ids = array();
    
    for ( $i = 1; $i <= $featured_content_number ; $i++ ) {
    $id = education_hub_get_option( 'featured_content_page_' . $i );
    if ( ! empty( $id ) ) {
    $ids[] = absint( $id );
    }
    }
    // Bail if no valid pages are selected.
    if ( empty( $ids ) ) {
    return $input;
    }
    
    $qargs = array(
    'posts_per_page' => esc_attr( $featured_content_number ),
    'no_found_rows'  => true,
    'orderby'        => 'post__in',
    'post_type'      => 'page',
    'post__in'       => $ids,
    );
    
    // Fetch posts.
    $all_posts = get_posts( $qargs );
    $contents = array();
    
    if ( ! empty( $all_posts ) ) {
    
    $cnt = 0;
    foreach ( $all_posts as $key => $post ) {
    
    $image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'education-hub-thumb' );
    $contents[ $cnt ]['images']  = $image_array;
    $contents[ $cnt ]['title']   = esc_html( $post->post_title );
    $contents[ $cnt ]['url']     = esc_url( get_permalink( $post->ID ) );
    $contents[ $cnt ]['excerpt'] = $post->post_content
    $cnt++;
    }
    }
    if ( ! empty( $contents ) ) {
    	$input = $contents;
    }
    break;
    
    default:
    break;
    }
    return $input;
    }

    Save and activate the child theme,
    This should solve your issue,

    Best regards.

    #8984
    cakeeater34
    Participant

    Sorry if you’re sick of me…

    I added that plugin… added the code to the functions.php in the child theme so now the functions.php contains this:

    <?php
    //
    // Recommended way to include parent theme styles.
    // (Please see http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme)
    //
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘child-style’,
    get_stylesheet_directory_uri() . ‘/style.css’,
    array(‘parent-style’)
    );
    }
    //
    // Your code goes below
    //

    function education_hub_get_featured_content_details( $input ) {

    $featured_content_type = education_hub_get_option( ‘featured_content_type’ );
    $featured_content_number = education_hub_get_option( ‘featured_content_number’ );

    switch ( $featured_content_type ) {

    case ‘featured-page’:

    $ids = array();

    for ( $i = 1; $i <= $featured_content_number ; $i++ ) {
    $id = education_hub_get_option( ‘featured_content_page_’ . $i );
    if ( ! empty( $id ) ) {
    $ids[] = absint( $id );
    }
    }
    // Bail if no valid pages are selected.
    if ( empty( $ids ) ) {
    return $input;
    }

    $qargs = array(
    ‘posts_per_page’ => esc_attr( $featured_content_number ),
    ‘no_found_rows’ => true,
    ‘orderby’ => ‘post__in’,
    ‘post_type’ => ‘page’,
    ‘post__in’ => $ids,
    );

    // Fetch posts.
    $all_posts = get_posts( $qargs );
    $contents = array();

    if ( ! empty( $all_posts ) ) {

    $cnt = 0;
    foreach ( $all_posts as $key => $post ) {

    $image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘education-hub-thumb’ );
    $contents[ $cnt ][‘images’] = $image_array;
    $contents[ $cnt ][‘title’] = esc_html( $post->post_title );
    $contents[ $cnt ][‘url’] = esc_url( get_permalink( $post->ID ) );
    $contents[ $cnt ][‘excerpt’] = $post->post_content
    $cnt++;
    }
    }
    if ( ! empty( $contents ) ) {
    $input = $contents;
    }
    break;

    default:
    break;
    }
    return $input;
    }

    But when I go to view the site.. I get this error. (I’ve since put the site back to the original theme, until this is resolved.)

    Parse error: syntax error, unexpected ‘$cnt’ (T_VARIABLE) in /home/vehicle16station/public_html/wp-content/themes/education-hub-child/functions.php on line 62

    AGAIN, thank you so much for your time in helping me get this figured out!

    #8989
    wensolutions
    Keymaster

    Sorry there was a syntax error in previous code given. Please paste following corrected code in your child theme’s functions.php file.

    function education_hub_get_featured_content_details( $input ) {
    
    $featured_content_type   = education_hub_get_option( 'featured_content_type' );
    $featured_content_number = education_hub_get_option( 'featured_content_number' );
    
    switch ( $featured_content_type ) {
    
    case 'featured-page':
    
    $ids = array();
    
    for ( $i = 1; $i <= $featured_content_number ; $i++ ) {
    $id = education_hub_get_option( 'featured_content_page_' . $i );
    if ( ! empty( $id ) ) {
    $ids[] = absint( $id );
    }
    }
    // Bail if no valid pages are selected.
    if ( empty( $ids ) ) {
    return $input;
    }
    
    $qargs = array(
    'posts_per_page' => esc_attr( $featured_content_number ),
    'no_found_rows'  => true,
    'orderby'        => 'post__in',
    'post_type'      => 'page',
    'post__in'       => $ids,
    );
    
    // Fetch posts.
    $all_posts = get_posts( $qargs );
    $contents = array();
    
    if ( ! empty( $all_posts ) ) {
    
    $cnt = 0;
    foreach ( $all_posts as $key => $post ) {
    
    $image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'education-hub-thumb' );
    $contents[ $cnt ]['images']  = $image_array;
    $contents[ $cnt ]['title']   = esc_html( $post->post_title );
    $contents[ $cnt ]['url']     = esc_url( get_permalink( $post->ID ) );
    $contents[ $cnt ]['excerpt'] = $post->post_content;
    $cnt++;
    }
    }
    if ( ! empty( $contents ) ) {
    	$input = $contents;
    }
    break;
    
    default:
    break;
    }
    return $input;
    }

    It should now work with formatting of ordered list in your site. For any confusion or problem please let us know.

    Thank you.

    #9010
    cakeeater34
    Participant

    I cannot thank you enough!!! This looks great!

    #9011
    wensolutions
    Keymaster

    Nice to know that the problem has been solved. If there are any further query, then, please feel free to post them.
    We will really appreciate if you could help us too by rating our theme in WordPress repo here:-
    https://wordpress.org/support/view/theme-reviews/education-hub

    Thank you 🙂 .

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.