Tagged: post slider, social share buttons
-
AuthorPosts
-
January 19, 2016 at 7:21 am #567660
Hi. I love your theme. I have customised one site quite a bit, but I have few questions about the SINGLE POST template. You can see from the web site’s single blog post that below there are few elements which I’m having trouble with. Maybe you could give me some pointers how to fix it.
1. Share buttons. I made them circle, round, but I have no idea how to add some 8px space between them. Do you have any idea how to add some space between social share buttons?
2. BLOG POST SLIDER. Is it possible to amend single post template the way that post slider would appear below the site automatically? Just like it is on front page. Adding short codes to every post can be quite frustrating. Post slider should appear at the very end of course, not before social share buttons. Right now, I have added it manually to each post, so it looks like this.
3. PRODUCT POST SLIDER. Is it possible to amend single post template the same way as with BLOG POST SLIDER but instead of blog post, there should be products.
Thank you for your help!
- This topic was modified 8 years, 11 months ago by masuurikas.
January 20, 2016 at 5:20 am #568362Hey masuurikas,
1. I’m not sure but setting a margin on the share buttons doesn’t seem to work, it might have something to do with them being displayed as table cell, maybe you could try inline or inline-block to see if that works better?
2/3. You can save templates with the items you need, I think that would be the easiest way to amend items to posts.
Regards,
RikardJanuary 21, 2016 at 7:21 am #569198Okay, I will try it out.
2/3 the problem is, that in this case SOCIAL SHARE will display at the very bottom, which would be not logical, since sharing should be right below the blog post.
Still, if I wanted to have BLOG POST SLIDER and PRODUCT SLIDER below the blog post, which kind of PHP tag should I include? And where should I include it?
Thank you for you help!
January 25, 2016 at 4:42 am #571043Hi There. Any idea about this one?
Still, if I wanted to have BLOG POST SLIDER and PRODUCT SLIDER below the blog post, which kind of PHP tag should I include? And where should I include it?
January 27, 2016 at 8:38 am #572662Hey!
Please try this in the functions.php file:
add_filter('ava_after_content', 'ava_after_main_container_mod', 20, 1); function ava_after_main_container_mod() { if(is_singular('post')) { $output = do_shortcode("[av_postslider link='category' columns='3' items='9' offset='0' contents='excerpt' preview_mode='auto' image_size='portfolio' autoplay='no' interval='5']"); echo $output; } }
Adjust the post slider shortcode as needed.
Regards,
IsmaelJanuary 27, 2016 at 9:09 am #572681Hi Ismael. I think it does not work. Please check. I added the script to functions.php file, but I don’t see any slider here on blog page: http://www.oot-oot.com/en/diy-projects-picked-for-november/
- This reply was modified 8 years, 11 months ago by masuurikas.
January 28, 2016 at 7:26 am #573528Hi,
Please send us a temporary admin login so that we can have a closer look. You can post the details in the Private Content section of your reply.
Thanks,
RikardJanuary 28, 2016 at 10:48 am #573597Hi Rikard, admin login is granted. See details in private content.
January 29, 2016 at 8:58 am #574368Hey!
We modified the code a bit:
add_filter('ava_after_content', 'ava_after_main_container_mod', 20, 1); function ava_after_main_container_mod($the_id) { if(is_singular('post')) { echo do_shortcode("[av_postslider link='category,1,32,133,102,120,33,118,14' columns='4' items='8' offset='no_duplicates' contents='excerpt' preview_mode='auto' image_size='portfolio' autoplay='no' interval='5']"); } }
Please add this in the Quick CSS field in order to fix the social share position.
#top .fullsize .template-blog .post .entry-content-wrapper .entry-footer:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } #top .fullsize .template-blog .post .entry-content-wrapper .entry-footer .av-share-box { margin-bottom: 50px; padding: 0; }
Best regards,
IsmaelJanuary 29, 2016 at 9:12 am #574376Thank you. Is it possible to show this slider below blog post the same way and style like it appear on front page? http://www.oot-oot.com/en/. You see it’s full with, perfect square images and only title below image.
February 1, 2016 at 5:07 am #575524Hi!
You can replace the code with this:
add_filter('ava_before_footer', 'ava_after_main_container_mod', 20, 1); function ava_after_main_container_mod($the_id) { if(is_singular('post')) { $output = '<div id="av_section_1" class="avia-section main_color avia-section-default avia-no-shadow avia-bg-style-scroll container_wrap fullsize">'; $output .= '<div class="container">'; $output .= '<div class="template-page content av-content-full alpha units">'; $output .= do_shortcode("[av_postslider link='category,1,32,133,102,120,33,118,14' columns='4' items='8' offset='no_duplicates' contents='excerpt' preview_mode='auto' image_size='portfolio' autoplay='no' interval='5']"); $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; echo $output; } }
Regards,
IsmaelFebruary 1, 2016 at 5:41 am #575547I see that it works: http://www.oot-oot.com/en/nordic-lifestyle-blogs-read/.
1) And if I want to have 2 sliders with a bit of headlines there, should I just copy this script twice in the functions.php file and change the categories? So, if I would like to achieve something like this: http://www.oot-oot.com/wp-content/themes/oot-oot/images/2-sliders.jpg
2) Oh and, by the way, the space between the social buttons and slider is quite big there.
February 1, 2016 at 6:57 am #575571Hey!
1.) Yes, you can duplicate the code but you have to change the function name.
2.) Please change this line:
$output = '<div id="av_section_1" class="avia-section main_color avia-section-default avia-no-shadow avia-bg-style-scroll container_wrap fullsize">';
.. to:
$output = '<div id="single-post-slider" class="avia-section main_color avia-section-default avia-no-shadow avia-bg-style-scroll container_wrap fullsize">';
Add this in the Quick CSS field:
single-post-slider { margin-top: -100px; }
Best regards,
IsmaelFebruary 1, 2016 at 7:22 am #575582If I want to add another slider there, do you mean that I should rename this part and that’s it? Can I name it to whatever I want? For example ava_after_postslider_container_mod?
add_filter(‘ava_before_footer’, ‘ava_after_footerposts_container_mod‘, 20, 1);
function ava_after_footerposts_container_mod($the_id) {- This reply was modified 8 years, 10 months ago by masuurikas.
February 1, 2016 at 8:22 am #575621Hey!
Yes, that’s it and adjust the “links” or category ids parameter in the shortcode. This part:
link='category,1,32,133,102,120,33,118,14'
Or you might want to use the product slider instead. Example:
[av_productslider columns='3' items='9' offset='0' sort='0' autoplay='no' interval='5']
Regards,
IsmaelFebruary 1, 2016 at 8:28 am #575625I see, I will try it. Can I also have a title, some text before each of these sliders? I would love to show a title in front of each slider, so it’s clear, what each slider is about.
February 1, 2016 at 8:59 am #575642And I added both these scripts in my functions.php file as you can see below. Changed the category ID-s. But I see only one slider appearing under blog post? How can I have 2 of them with titles before each slider? As you can see, only one slider: http://www.oot-oot.com/en/nordic-lifestyle-blogs-read/
These are the functions I included as you recommended:
add_filter(‘ava_before_footer’, ‘ava_after_main_container_mod’, 20, 1);
function ava_after_main_container_mod($the_id) {
if(is_singular(‘post’)) {
$output = ‘<div id=”single-post-slider” class=”avia-section main_color avia-section-default avia-no-shadow avia-bg-style-scroll container_wrap fullsize”>’;
$output .= ‘<div class=”container”>’;
$output .= ‘<div class=”template-page content av-content-full alpha units”>’;
$output .= do_shortcode(“[av_postslider link='category,1,32,133,102,120,33,118,14' columns='4' items='8' offset='no_duplicates' contents='title' preview_mode='auto' image_size='masonry' autoplay='no' interval='5']“);
$output .= ‘</div>’;
$output .= ‘</div>’;
$output .= ‘</div>’;
echo $output;
}
}add_filter(‘ava_before_footer’, ‘ava_after_postslider_container_mod’, 20, 1);
function ava_after_postslider_container_mod($the_id) {
if(is_singular(‘post’)) {
$output = ‘<div id=”single-post-slider” class=”avia-section main_color avia-section-default avia-no-shadow avia-bg-style-scroll container_wrap fullsize”>’;
$output .= ‘<div class=”container”>’;
$output .= ‘<div class=”template-page content av-content-full alpha units”>’;
$output .= do_shortcode(“[av_postslider link='category,100,140,139,136,138,172,171,170,169,168,137' columns='4' items='8' offset='no_duplicates' contents='title' preview_mode='auto' image_size='masonry' autoplay='no' interval='5']“);
$output .= ‘</div>’;
$output .= ‘</div>’;
$output .= ‘</div>’;
echo $output;
}
}- This reply was modified 8 years, 10 months ago by masuurikas.
February 2, 2016 at 8:42 am #576304Hi!
It didn’t produce an error? It should because the function names are the same. Change the function name like I said on my previous post then adjust the offset parameter of the shortcodes from “no_duplicates” to “0” (deactivate offset). https://kriesi.at/support/topic/single-post-template-with-post-slider-and-social-share/#post-575571
Regards,
IsmaelFebruary 4, 2016 at 6:37 am #577593Hi,
In my opinion I did exactly as you wrote. I renamed the function name, now also deactivated offset. Still, when I look at the post, I see only 1 slider there: http://www.oot-oot.com/en/nordic-lifestyle-blogs-read/
This is what I have in FUNCTIONS.PHP file:
1)
add_filter(‘ava_before_footer’, ‘ava_after_main_container_mod’, 20, 1);
function ava_after_main_container_mod($the_id) {
if(is_singular(‘post’)) {
$output = ‘<div id=”single-post-slider” class=”avia-section main_color avia-section-default avia-no-shadow avia-bg-style-scroll container_wrap fullsize”>’;
$output .= ‘<div class=”container”>’;
$output .= ‘<div class=”template-page content av-content-full alpha units”>’;
$output .= do_shortcode(“[av_postslider link='category,1,32,133,102,120,33,118,14' columns='4' items='8' offset='0' contents='title' preview_mode='auto' image_size='masonry' autoplay='no' interval='5']“);
$output .= ‘</div>’;
$output .= ‘</div>’;
$output .= ‘</div>’;
echo $output;
}
}2)
add_filter(‘ava_after_postslider’, ‘ava_after_postslider_container_mod’, 20, 1);
function ava_after_postslider_container_mod($the_id) {
if(is_singular(‘post’)) {
$output = ‘<div id=”single-post-slider” class=”avia-section main_color avia-section-default avia-no-shadow avia-bg-style-scroll container_wrap fullsize”>’;
$output .= ‘<div class=”container”>’;
$output .= ‘<div class=”template-page content av-content-full alpha units”>’;
$output .= do_shortcode(“[av_postslider link='category,100,140,139,136,138,172,171,170,169,168,137' columns='4' items='8' offset='0' contents='title' preview_mode='auto' image_size='masonry' autoplay='no' interval='5']“);
$output .= ‘</div>’;
$output .= ‘</div>’;
$output .= ‘</div>’;
echo $output;
}
}February 5, 2016 at 1:18 am #578136Hi there, what do you think of these 2 functions? It does not seem to work the way you suggested. I have put 2 scripts in FUNCTIONS.PHP file, but I only see 1 slider. This is what I would like to achieve, 2 sliders with 2 headlines above each slider: http://www.oot-oot.com/wp-content/themes/oot-oot/images/2-sliders.jpg. I would appreciate if you could help me out how exactly I should edit the functions.php file to achieve this.
Thank you!
February 5, 2016 at 3:35 am #578186I think I got it now : ) Actually, instead of 2 scripts I had to add 2 shortcodes in one script. So the script would look like this…
add_filter(‘ava_before_footer’, ‘ava_after_main_container_mod’, 20, 1);
function ava_after_main_container_mod($the_id) {
if(is_singular(‘post’)) {
$output = ‘<div id=”single-post-slider” class=”avia-section main_color avia-section-default avia-no-shadow avia-bg-style-scroll container_wrap fullsize”>’;
$output .= ‘<div class=”container”>’;
$output .= ‘<div class=”template-page content av-content-full alpha units”>’;
$output .= do_shortcode(“[av_heading heading='LOE VEEL: ' tag='h3' style='blockquote modern-quote modern-centered' size='23' subheading_active='' subheading_size='15' padding='10' color='custom-color-heading' custom_font='#222222'][/av_heading]“);
$output .= do_shortcode(“[av_postslider link='category,42,58,135,127,124,123,122,131' columns='4' items='-1' offset='0' contents='title' preview_mode='custom' image_size='portfolio' autoplay='no' interval='5']“);
$output .= do_shortcode(“[av_heading heading='MEIE TOOTED: ' tag='h3' style='blockquote modern-quote modern-centered' size='23' subheading_active='' subheading_size='15' padding='10' color='custom-color-heading' custom_font='#222222'][/av_heading]“);
$output .= do_shortcode(“[av_postslider link='portfolio_entries,137,168,169,170,171,172,138,179,136,139,140,100' columns='4' items='-1' offset='0' contents='title' preview_mode='custom' image_size='portfolio' autoplay='no' interval='5']“);
$output .= ‘</div>’;
$output .= ‘</div>’;
$output .= ‘</div>’;
echo $output;
}
}February 5, 2016 at 7:37 am #578322February 5, 2016 at 12:43 pm #578460Thanks Ismael! We can close the topic now! Great theme you have there and great support!
-
AuthorPosts
- The topic ‘Single post template with post slider and social share’ is closed to new replies.