-
AuthorPosts
-
March 15, 2014 at 5:02 pm #238084
Hi there I could use some help on a couple of things.
1) I am trying to get my fullwidth masonry portfolio to sort by title instead of date. I read the enfold documentation copied the php snippet went to appearance – editor – child theme – theme functions (functions php) and inserted the snippet so it looks like this.
<?php
/*
function custom_post_grid_query( $query, $params ) {
$query[‘orderby’] = ‘title’;
$query[‘order’] = ‘ASC’;
return $query;
}
add_filter( ‘avia_post_grid_query’, ‘custom_post_grid_query’, 10, 2);
*/
I saved, updated, cleared my cache and it is still sorting by date. Can you point out where I went wrong?2) I would like to stop the little yellow box from displaying on mouse hover over my portfolio images. I went to each image removed the image caption, title etc. so there was nothing left to display but that didn’t stop the yellow box. Now it is defaulting/displaying the title of the page where the image is pulled from. Is there something else I can do?
Thnx
KimMarch 16, 2014 at 5:53 am #238200Hi Kimberlyjo!
1.) Please edit config-templatebuilder > avia-shortcodes > masonry_entries.php, find this code on line 382:
$sort_terms = get_terms( $this->atts['taxonomy'] , array('hide_empty'=>true) );
Replace it with:
$sort_terms = get_terms( $this->atts['taxonomy'] , array('hide_empty'=>true, 'orderby' => 'name', 'order' => 'ASC',) );
`
2.) What do you mean by yellow box? Can you please give us a link to the website? A screenshot will help.
Cheers!
IsmaelMarch 16, 2014 at 3:40 pm #238297Hi Ismael!
Thanks on the portfolio sort. This will make all my portfolios sort by title right?I’ve attached a screen shot of the little yellow box I would like to stop
[IMG]http://i60.tinypic.com/20k7z4k.png[/IMG]Thanks!
March 16, 2014 at 3:47 pm #238300Looks like I added the screenshot improperly. Maybe this will work…
March 17, 2014 at 9:08 am #238542Hey!
Edit js > avia.js, find this code at the very beginning:
$(document).ready(function() { var aviabodyclasses = AviaBrowserDetection('html');
Below, add this code:
$('a.av-masonry-entry').attr('title', '');
Remove browser cache then reload the page a few times.
Regards,
IsmaelMarch 19, 2014 at 6:26 am #239852Hi Ismael!
Thanks for the instructions. I was able to adjust the js file now the yellow info box doesn’t show on the images in my masonry gallery. Is there a way to eliminate that little yellow box from displaying on all images within my site?Also
I edited the onfig-templatebuilder > avia-shortcodes > masonry_entries.php, as instructed but it doesn’t change the sort. I reset the cache and reloaded the page several times but it didn’t work. here is what the code looks like. Can you tell where I went wrong?$this->atts[‘categories’] = $this->atts[‘link’][1];
}
else
{
$this->atts[‘categories’] = array();
}
}
}function sort_buttons()
{
$sort_terms = get_terms( $this->atts[‘taxonomy’] , array(‘hide_empty’=>true, ‘orderby’ => ‘name’,
‘order’ => ‘ASC’,) );$current_page_terms = array();
$term_count = array();
$display_terms = is_array($this->atts[‘categories’]) ? $this->atts[‘categories’] : array_filter(explode(‘,’,$this->atts[‘categories’]));foreach ($this->loop as $entry)
{
if($current_item_terms = get_the_terms( $entry[‘ID’],Thanks,
KimMarch 20, 2014 at 9:20 am #240564Hey!
1) Try this code instead
$('a, img').attr('title', '');
2) Use this code and insert it at the very bottom of functions.php (parent or child theme):
add_filter('avia_masonry_entries_query', 'avia_random_image_query', 10, 2); function avia_random_image_query($query, $params) { if(empty($query['post_mime_type'])) { $query['orderby'] = "title"; $query['order'] = 'ASC'; } return $query; }
Cheers!
PeterMarch 20, 2014 at 5:44 pm #240803Hi Peter,
Ohhh. This is very stubborn. It continues to sort by date…. so okay.
I added the code to my functions.php file in my child theme and it looks like this:
<?php
/* add_filter(‘avia_masonry_entries_query’, ‘avia_random_image_query’, 10, 2);
function avia_random_image_query($query, $params)
{
if(empty($query[‘post_mime_type’]))
{
$query[‘orderby’] = “title”;
$query[‘order’] = ‘ASC’;
}return $query;
}
*/and the masonry_entries.php code looks like this:
{
$this->atts[‘categories’] = array();
}
}
}function sort_buttons()
{
$sort_terms = get_terms( $this->atts[‘taxonomy’] , array(‘hide_empty’=>true, ‘orderby’ => ‘name’,
‘order’ => ‘ASC’,) );$current_page_terms = array();
$term_count = array();
$display_terms = is_array($this->atts[‘categories’]) ? $this->atts[‘categories’] : array_filter(explode(‘,’,$this->atts[‘categories’]));Can you tell where the problem is?
Thanks,
KimMarch 21, 2014 at 6:33 am #241031Hey!
Can you please post the whole code on http://pastebin.com/? I think there’s something wrong with it.
Regards,
IsmaelMarch 21, 2014 at 1:35 pm #241141Hi Ismael,
I posted the whole code of my masonry_entries.php file here:
http://pastebin.com/6rFR90Dg
and titled it “masonry for Ismael”
just in case I also pasted my child theme functions.php here:
http://pastebin.com/0pQQNBzK
and it is titled “child theme functions”Thanks,
Kim- This reply was modified 10 years, 8 months ago by Kimberlyjo. Reason: updated a link
-
AuthorPosts
- The topic ‘Portfolio sort by title and title display on hover’ is closed to new replies.