-
AuthorPosts
-
January 26, 2016 at 3:16 pm #572152
Hi,
I want to display the title and meta info above the feature image. My current solution works ok, but when the page loads the title + meta appears first below the feature image and then jumps up. I would like to stop the jumping and display it above the feature image all the time.
Here is a link so you can see what I mean:
http://www.lovelifesolved.com/blogHere is the code that I use:
In my child theme’s function.php:
function change_aviajs() { wp_dequeue_script( 'avia-default' ); wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true ); } add_action( 'wp_enqueue_scripts', 'change_aviajs', 1 );
In my child theme’s avia.js:
jQuery('article.post').each(function(){ jQuery(this).find('.entry-content-header').after(jQuery(this).find('.big-preview').detach()); })
Thanks!
January 28, 2016 at 1:12 am #573364Hey!
You can go to Blog Layout > Blog Styling and select “Elegant”, that will put the title above the image.
Regards,
JosueJanuary 28, 2016 at 12:17 pm #573661Could you tell me what code makes the title appear above in the “Elegant” Blog styling? I don’t want to change the rest of my blog’s styling.
January 28, 2016 at 12:21 pm #573665Line 174 in /includes/loop-index.php, you could try changing that to:
if( $blog_global_style != 'elegant-blog' )
So it applies when non-elegant blog style is selected, additional adjusting may be needed.
January 28, 2016 at 4:58 pm #573852Sorry Josue, but that won’t solve it. My problem isn’t that I want to display the title above the feature image, I already got that to work. My problem is, that the title and meta info jumps from below the feature image above it while the page is loading.
There seems to be an issue with the right queuing of the child theme files and it would be amazing if you or someone else from the support team could take a look at that.
Here is the code that I use again:
In my child theme’s function.php:
function change_aviajs() { wp_dequeue_script( 'avia-default' ); wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true ); } add_action( 'wp_enqueue_scripts', 'change_aviajs', 1 );
In my child theme’s avia.js:
jQuery('article.post').each(function(){ jQuery(this).find('.entry-content-header').after(jQuery(this).find('.big-preview').detach()); })
Thanks!
January 28, 2016 at 8:11 pm #574030Hey!
You are correct. Due to the queueing of the files there is a flash of style change. You cannot change the queuing of files easily it is out of our support scope.However there is a much easier way to achieve this effect.
Please undo the changes and follow the steps provided by josue. You can go to Blog Layout > Blog Styling and select “Elegant”, that will put the title above the image.
It will produce close results you are trying to achieve and it will be much easier to tweak it.
Cheers!
Vinay- This reply was modified 8 years, 11 months ago by Vinay.
January 29, 2016 at 12:13 pm #574442I know what you mean, however, changing the blog style is not practical for me, as it would change the whole look of the blog.
thx for your help anyway!
-
AuthorPosts
- The topic ‘Title and meta info "jump".’ is closed to new replies.