Home › Forums › Free Themes › Education Hub › Bullet point list & bolding on home page
Tagged: formatting, ordered list
- This topic has 9 replies, 2 voices, and was last updated 8 years, 5 months ago by wensolutions.
-
AuthorPosts
-
May 26, 2016 at 10:30 am #8880cakeeater34Participant
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!
May 26, 2016 at 11:03 am #8884wensolutionsKeymasterHello,
Can we have your better site URL so that we can monitor your issues better?
Waiting for your reply
Best regards
May 26, 2016 at 11:04 am #8885cakeeater34Participanthttp://www.vehicledonationstation.com/
Thanks for the prompt response!
May 26, 2016 at 11:28 am #8893wensolutionsKeymasterHello,
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.
May 26, 2016 at 7:40 pm #8909cakeeater34ParticipantThe 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.
May 27, 2016 at 12:35 am #8912wensolutionsKeymasterHello,
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.
May 27, 2016 at 7:59 pm #8984cakeeater34ParticipantSorry 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!
May 28, 2016 at 3:27 am #8989wensolutionsKeymasterSorry 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.
May 28, 2016 at 10:48 pm #9010cakeeater34ParticipantI cannot thank you enough!!! This looks great!
May 28, 2016 at 11:57 pm #9011wensolutionsKeymasterNice 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-hubThank you 🙂 .
-
AuthorPosts
- You must be logged in to reply to this topic.