- This topic has 16 replies, 2 voices, and was last updated 9 years, 5 months ago by Theme Horse Support Team.
-
AuthorPosts
-
June 3, 2015 at 6:47 pm #25378arisParticipant
Apparently it is possible to create a Page (frontpage) which can show ONLY a specific category of posts in Blog Medium template.
What if i need to crate a simple page and connect the Blog medium template?! Is it possible to show only a specific post category? If Yes, how? If not, is there any workaround.. An other solution you can put us on the right way?
June 5, 2015 at 5:54 am #25413Theme Horse Support TeamKeymasterhi aris,
If you use blog medium template then this feature is not available in our theme. If you use the default post then you can only display the specific category of posts only in front page not in other page. We have designed our theme this way. To display category post in blog medium template then it needs code customization and you need to hire a developer to fix it.
Thank you!
June 5, 2015 at 8:39 am #25417arisParticipantHi there,
Ok lets look the problem from a different point of view!
I’ve found a way to “cheat” the system so it shows only posts from a specific category (no code customization no nothing). However it seems that Blog Image Large template is the default template because all my posts from this specific category are showing in the same way as this template
Look my site: http://www.artech-it.com/category/education/
Your site (Blog Image Large): https://www.themehorse.com/preview/ultimate-pro/blog-image-large/So i think there must be a way to change the default blog template…
So my question would be: How can i define the BLOG IMAGE MEDIUM as a default Template for all my posts 🙂
Thanks in advance
June 8, 2015 at 5:30 am #25463Theme Horse Support TeamKeymasterHi aris,
Yes you can make it default but you have to customize the code. Before making any changes in the code first of all you need to create a child theme and then only customize the code so that your updated version will not lose the code.
You go to the theme folder -> inc -> structure -> content-extension.php on line no 87 can you see this functions
if ( ! function_exists( 'ultimate_theloop_for_archive' ) ) :
If yes then can you see this line no 134 to 143, you will find this code.
<?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .= '</figure><!-- .post-featured-image -->'; echo $image; } ?>
Replace above code and add this below code
<?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured-medium', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .= '</figure><!-- .post-featured-image -->'; echo $image; } ?>
and after doing this go to line no 238 and can you see this code if ( ! function_exists( ‘ultimate_theloop_for_single’ ) ) :
if yes then goto line no 276 to 287 and replace the old code and add the below code<?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured-medium', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .= '</figure><!-- .post-featured-image -->'; echo $image; } ?>
Hope this may help you
Thank you!
June 9, 2015 at 6:17 am #25506arisParticipantHi there,
My child theme has the following files/folders
footer.php
functions.php
style.cssi created the inc->structure folders and copied the content-extension.php file from the main theme folder in the same structure (inside structure folder of my child theme)
i made the above changes to the file in my child theme folder and the child theme is activated. The default post template is not changing, i’m seeing the same format
http://www.artech-it.com/category/education/
I want it to be like yours
https://www.themehorse.com/preview/ultimate-pro/blog-image-medium/
June 10, 2015 at 5:47 am #25535Theme Horse Support TeamKeymasterHi aris,
First of all you need to unhook the functions and then only customize the code. Creating the same directory folder and copying all the content will not change the code. Here is a simple example how to unhook functions and you do the same for the above code that i have added yesterday.
This is just an example.//unhook functions // Unhook default Thematic functions function unhook_thematic_functions() { // Don't forget the position number if the original function has one remove_action( 'attitude_404_content', 'attitude_display_404_page_content', 10 ); } add_action('init','unhook_thematic_functions'); // removes the header content by using hook attitude_header add_action( 'attitude_404_content', 'attitude_child_display_404_page_content', 10 ); /** * function to show the footer info, copyright information */ function attitude_child_display_404_page_content() { ?> <div id="content"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Error 404-Page NOT Found', 'attitude' ); ?></h1> </header> <div class="entry-content clearfix" > <p>Thank you</p> </div><!-- .entry-content --> </div><!-- #content --> <?php }
All this code you must add in the functions.php file. We need only functions.php and style.css file
Thank you!
June 10, 2015 at 5:48 am #25536Theme Horse Support TeamKeymasterHi aris,
First of all you need to unhook the functions and then only customize the code. Creating the same directory folder and copying all the content will not change the code. Here is a simple example how to unhook functions and you do the same for the above code that i have added yesterday.
This is just an example.//unhook functions // Unhook default Thematic functions function unhook_thematic_functions() { // Don't forget the position number if the original function has one remove_action( 'attitude_404_content', 'attitude_display_404_page_content', 10 ); } add_action('init','unhook_thematic_functions'); // removes the header content by using hook attitude_header add_action( 'attitude_404_content', 'attitude_child_display_404_page_content', 10 ); /** * function to show the footer info, copyright information */ function attitude_child_display_404_page_content() { ?> <div id="content"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Error 404-Page NOT Found', 'attitude' ); ?></h1> </header> <div class="entry-content clearfix" > <p>Thank you</p> </div><!-- .entry-content --> </div><!-- #content --> <?php }
All this code you must add in the functions.php file.
Thank you!June 10, 2015 at 6:46 pm #25565arisParticipantHi again,
Could you kindly be more specific? I have already a functions.php and style.css in my child theme. I don’t know which function to unhook
Many thanks in advance (I’m using ultimate-pro template)
June 11, 2015 at 4:58 am #25578Theme Horse Support TeamKeymasterhi aris,
First of all unhook this functions
add_action( 'ultimate_loop_content', 'ultimate_theloop', 10 );
with `remove_action( ‘ultimate_loop_content’, ‘ultimate_theloop’, 1
0 );`
After doing it add this code
add_action(‘init’,’unhook_thematic_functions’);add_action( 'ultimate_loop_content', 'ultimate_loop_content_child', 10 ); /** * Shows the loop content */ function ultimate_loop_content_child() { if( is_page() ) { if( is_page_template( 'page-templates/page-template-blog-image-large.php' ) ) { ultimate_theloop_for_template_blog_image_large(); } elseif( is_page_template( 'page-templates/page-template-blog-image-medium.php' ) ) { ultimate_theloop_for_template_blog_image_medium(); } elseif( is_page_template( 'page-templates/page-template-blog-full-content.php' ) ) { ultimate_theloop_for_template_blog_full_content(); } else { ultimate_theloop_for_page(); } } elseif( is_single() ) { ultimate_theloop_for_single(); } elseif( is_search() ) { ultimate_theloop_for_search(); } else { ultimate_theloop_for_archive(); } }
After adding this content you need to copy the content from content-extension.php from line no 86 to 735 in functions.php and edit the code that i have previously added.
Hope this may help you
Thank you!June 16, 2015 at 11:24 am #25719arisParticipantHi,
I think I’m confused. I really would appreciate if you send me, step by step what should i do!
What i need is to change ONLY default BLOG Template (not the page one). I want the BLOG-Medium-Image as a default template for all my posts (only posts, not pages).
(if you remember, my problem was that i was not able to show posts from specific category within a page with Blog-Image-Medium template, so i just created a Post Category Menu Item which shows posts only from a specific category, however the default template for posts is Blog-Images-Large, which i don’t want).
https://www.themehorse.com/preview/ultimate-pro/blog-image-medium/ ( for category posts listing )
I have tried everything you told me with the below order
1- Copied the content-extension.php to the child theme and made the changes (replaced the code you told me)
2- Unhooked the functions in functions.php ( it remove all the pages and posts )
3- added the code as you advised in functions.php (didn’t work)So if it is possible send me in one post step by step what i should do, will be a great help
regards,
Aris
June 17, 2015 at 5:14 am #25737Theme Horse Support TeamKeymasterHi aris,
We cannot provide you all step by step. For this you need to hire a developer.
First of all create two files styles.css and functions.php file
under functions.php file add this code
unhook this functions
add_action( 'ultimate_loop_content', 'ultimate_theloop', 10 );
with `remove_action( ‘ultimate_loop_content’, ‘ultimate_theloop’, 1
0 );`After doing it add this code add this code
add_action(‘init’,’unhook_thematic_functions’); add_action( 'ultimate_loop_content', 'ultimate_loop_content_child', 10 ); /** * Shows the loop content */ function ultimate_loop_content_child() { if( is_page() ) { if( is_page_template( 'page-templates/page-template-blog-image-large.php' ) ) { ultimate_theloop_for_template_blog_image_large(); } elseif( is_page_template( 'page-templates/page-template-blog-image-medium.php' ) ) { ultimate_theloop_for_template_blog_image_medium(); } elseif( is_page_template( 'page-templates/page-template-blog-full-content.php' ) ) { ultimate_theloop_for_template_blog_full_content(); } else { ultimate_theloop_for_page(); } } elseif( is_single() ) { ultimate_theloop_for_single(); } elseif( is_search() ) { ultimate_theloop_for_search(); } else { ultimate_theloop_for_archive(); } }
Now your child theme funtions is ready. Now go to the theme folder -> inc -> structure -> content-extension.php on line no 86 you will find this code
/****************************************************************************************/ if ( ! function_exists( 'ultimate_theloop_for_archive' ) ) :
and copy from this line 86 to line no 735 where in line no 735 you will find this code.
$wp_query = $temp_query; wp_reset_postdata(); } endif; /****************************************************************************************/
Are you still with me? Ok then you need to change the code in your functions.php file
under this functions
if ( ! function_exists( 'ultimate_theloop_for_archive' ) ) :
can you see this code line no 134 to 143, there you replace this code `<?php
if( has_post_thumbnail() ) {
$image = ”;
$title_attribute = apply_filters( ‘the_title’, get_the_title( $post->ID ) );
$image .= ‘<figure class=”post-featured-image”>’;
$image .= ‘<a href=”‘ . get_permalink() . ‘” title=”‘.the_title( ”, ”, false ).'”>’;
$image .= get_the_post_thumbnail( $post->ID, ‘featured’, array( ‘title’ => esc_attr( $title_attribute ), ‘alt’ => esc_attr( $title_attribute ) ) ).'</a>’;
$image .= ‘</figure><!– .post-featured-image –>’;
echo $image;
} ?>` with<?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .= '</figure><!-- .post-featured-image -->'; echo $image; } ?>
with
<?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured-medium', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .= '</figure><!-- .post-featured-image -->'; echo $image; } ?>
Paste this code for single functions too on line no 238
if ( ! function_exists( 'ultimate_theloop_for_single' ) ) :
Add the above code just you have done it now<?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured-medium', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .= '</figure><!-- .post-featured-image -->'; echo $image; } ?>
Thank you!
June 17, 2015 at 5:15 am #25738Theme Horse Support TeamKeymasterHi aris,
We cannot provide you all step by step. For this you need to hire a developer.
First of all create two files styles.css and functions.php file
under functions.php file add this code
unhook this functions
add_action( 'ultimate_loop_content', 'ultimate_theloop', 10 );
with `remove_action( ‘ultimate_loop_content’, ‘ultimate_theloop’, 1
0 );`After doing it add this code add this code
add_action(‘init’,’unhook_thematic_functions’); add_action( 'ultimate_loop_content', 'ultimate_loop_content_child', 10 ); /** * Shows the loop content */ function ultimate_loop_content_child() { if( is_page() ) { if( is_page_template( 'page-templates/page-template-blog-image-large.php' ) ) { ultimate_theloop_for_template_blog_image_large(); } elseif( is_page_template( 'page-templates/page-template-blog-image-medium.php' ) ) { ultimate_theloop_for_template_blog_image_medium(); } elseif( is_page_template( 'page-templates/page-template-blog-full-content.php' ) ) { ultimate_theloop_for_template_blog_full_content(); } else { ultimate_theloop_for_page(); } } elseif( is_single() ) { ultimate_theloop_for_single(); } elseif( is_search() ) { ultimate_theloop_for_search(); } else { ultimate_theloop_for_archive(); } }
Now your child theme funtions is ready. Now go to the theme folder -> inc -> structure -> content-extension.php on line no 86 you will find this code
/****************************************************************************************/ if ( ! function_exists( 'ultimate_theloop_for_archive' ) ) :
and copy from this line 86 to line no 735 where in line no 735 you will find this code.
$wp_query = $temp_query; wp_reset_postdata(); } endif; /****************************************************************************************/
Are you still with me? Ok then you need to change the code in your functions.php file
under this functions
if ( ! function_exists( 'ultimate_theloop_for_archive' ) ) :
can you see this code line no 134 to 143, there you replace this code `<?php
if( has_post_thumbnail() ) {
$image = ”;
$title_attribute = apply_filters( ‘the_title’, get_the_title( $post->ID ) );
$image .= ‘<figure class=”post-featured-image”>’;
$image .= ‘<a href=”‘ . get_permalink() . ‘” title=”‘.the_title( ”, ”, false ).'”>’;
$image .= get_the_post_thumbnail( $post->ID, ‘featured’, array( ‘title’ => esc_attr( $title_attribute ), ‘alt’ => esc_attr( $title_attribute ) ) ).'</a>’;
$image .= ‘</figure><!– .post-featured-image –>’;
echo $image;
} ?>` with<?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .= '</figure><!-- .post-featured-image -->'; echo $image; } ?>
with
<?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured-medium', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .= '</figure><!-- .post-featured-image -->'; echo $image; } ?>
Paste this code for single functions too on line no 238
if ( ! function_exists( 'ultimate_theloop_for_single' ) ) :
Add the above code just you have done it now<?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured-medium', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .= '</figure><!-- .post-featured-image -->'; echo $image; } ?>
If you are still unable then you need to hire a developer to fix it.
Thank you!June 17, 2015 at 5:19 am #25740arisParticipantFirst of all,
THANK YOU! i haven’t tried it yet but only the support you are showing means alot to me. Again, Thank You
i will check it later and tell you if worked 😉
regards,
Aris
June 17, 2015 at 8:03 am #25743arisParticipantHello there…
IT WORKED!
what i had to do is copy the modified content-extension.php lines 86-735 to the functions.php of the child theme.
I have one question though…(sorry for so many questions)
In your Blog-Image-Medium Layout the test is in the left of the image
https://www.themehorse.com/preview/ultimate-pro/blog-image-medium/
In my modified code the Image is showing however the text is showing below the image and not next to it. I need it to be exactly like yours because its more beautiful
http://www.artech-it.com/category/education/
can you please help?
regards,
Aris
June 18, 2015 at 6:23 am #25759Theme Horse Support TeamKeymasterOk that’s great aris and just do one things.
can you see this code in line no 100 of content-extension.php, There you will find this code
<section id="post-<?php the_ID(); ?> clearfix" <?php post_class(); ?>>
Replace this above code with
<section id="post-<?php the_ID(); ?> clearfix" class="post blog-medium" >
in your child theme.Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.