-
AuthorPosts
-
August 7, 2014 at 6:53 pm #301268
Hi,
I’d like to use the masonry tiles to display some text & general content, so i would like the tile to not be clickable, but only some of them, specified via a checkbox in the post editor perhaps ?
Can you guys point me in the right direction ?
Cheers.August 8, 2014 at 4:12 am #301416Hello!
It is possible but it would require a heavy customization to the theme, unfortunately that’s beyond the scope of the support we can offer. If you really need it try contacting a developer.
Cheers!
JosueAugust 8, 2014 at 1:04 pm #301607I figured full code might be too much to ask, but do you mind telling me which files to look into ? I can add the checkbox and do that part, but i can’t find the right file to edit how masonry works.
For example, changing the way masonry outputs different post types or formats ? For example, make the quote post format not clickable, or a custom post type?August 8, 2014 at 6:59 pm #301780Hey!
You’d need to create a new metabox so you can bind a value to the post (that checkbox for example), you can use this plugin to do that:
https://wordpress.org/plugins/meta-box/Once you done that you can use that data to conditionally disable the link on the masonry title, look for the html function located in /config-templatebuilder/avia-shortcodes/masonry_entries.php, line 456.
Best regards,
JosueAugust 11, 2014 at 3:59 pm #302673Thanks a lot Josue, helped me solve it.
For anyone else that might be interested, here’s how.the line to edit is #678, that is this :
$this->loop[$key]['url'] = get_permalink($id);
I have a custom post type called “tile”, so for those i want to disable the link. That is done with this conditional added to immediately after the line above
if (strpos($this->loop[$key]['url'], '/tile/') !== FALSE) $this->loop[$key]['url']='#';
This checks if /tile/ is in the url, which for custom post types it would be (replace tile with your own custom post type) and if it finds it, it replaces the link with a simple #. Adding this rather than changing the line above ensures the links still work for all other post types (folio, blog, etc)- This reply was modified 10 years, 4 months ago by radugidei.
August 11, 2014 at 8:18 pm #302839Nice workaround, glad i could help :)
Cheers!
Josue -
AuthorPosts
- The topic ‘Masonry tiles with no link’ is closed to new replies.