Forum Replies Created
-
AuthorPosts
-
[email protected]
ParticipantHello Long,
Thank you, I did try that already. What I am seeing happening is, the SVG is 120x120, but when it outputs that file it is given the height and width of "0" -- therefore you cannot see the SVG.
Here is a video showing what happens: https://youtu.be/t2CYNcb5lto
Also, I tried this after the video and it works. I can do that, but I am wondering why the code snippet is not outputting or at least an option to apply a custom width/height.
Original Twig snippet
{% for item in post.icon %} <img src="{{ item.full.url }}" width="{{ item.full.width }}" height="{{ item.full.height }}" alt="{{ item.full.alt }}"> {% endfor %}Work Around snippet
{% for item in post.icon %} <img src="{{ item.full.url }}" width="42" height="42" alt="{{ item.full.alt }}"> {% endfor %}Any thoughts?
Cheers
[email protected]
ParticipantHey Long,
Me again ... so never mind with the issue above. What I am seeing is the error is not coming from me or the plugin, but rather how Oxygen renders the custom variables. Yes it can probably work somehow, but it seems kind of pointless to make a hack for a simple process.
I love metabox ... it is an amazing plugin that makes life so much easier, so to just hack it for a simple function doesn't make sense.
So I am just going to move away from Oxygen and just use Views with Twig! =)
Cheers and thanks again for your time and effort.
[email protected]
ParticipantAlso Long, just as an FYI. I have tried the same output on a theme based site that used "Views" instead on injecting the code and all works great.
So I am wondering if it has to do with the setup or the execution with Oxygen?
Cheers
[email protected]
ParticipantHello Long,
Thank you for your reply. Here is the generated PHP code. I am using Oxygen and Script Organizer, so I took the generated code and then created a script to run, as I don't have a functions.php file. The format still doesn't change. Any thought?
<?php add_filter( 'rwmb_meta_boxes', 'rswp_oxygen_dateFormat_events' ); function rswp_oxygen_dateFormat_events( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Event Details', 'rswp_oxygen' ), 'id' => 'event-details', 'post_types' => ['event'], 'context' => 'after_title', 'fields' => [ [ 'name' => __( 'Event Details', 'rswp_oxygen' ), 'id' => $prefix . 'event_details', 'type' => 'textarea', 'rows' => 6, 'required' => 1, 'save_field' => 1, ], [ 'name' => __( 'Event Date', 'rswp_oxygen' ), 'id' => $prefix . 'event_date', 'type' => 'date', 'required' => 1, 'js_options' => [ 'dateFormat' => 'd-MM-yy', ], 'save_field' => 1, ], [ 'name' => __( 'Event Time', 'rswp_oxygen' ), 'id' => $prefix . 'event_time', 'type' => 'time', 'required' => 1, 'save_field' => 1, ], [ 'name' => __( 'Event Location', 'rswp_oxygen' ), 'id' => $prefix . 'event_location', 'type' => 'textarea', 'required' => 1, 'save_field' => 1, ], ], ]; return $meta_boxes; }Sorry, I am new at this, so still a bit of a learning curve. Thanks again for your help.
Cheers
-
AuthorPosts