Forum Replies Created
-
AuthorPosts
-
August 7, 2024 at 11:26 PM in reply to: How to show relationships in same order as set in backend? #46111
EddyPiV
ParticipantPeter, this is the code for the page.
{% set args1 = { post_type: 'repetitie-avond', posts_per_page: -1, orderby: 'date', order: 'asc' } %} {% set posts = mb.get_posts( args1 ) %} {% for post in posts %} <h2><strong>{{ post.title }}</strong></h2> <p>{{ post.content }}</p> {% set args2 = {post_type: 'muziek', nopaging: true, orderby:'none', relationship: {id: 'muziek-op-repetitie-avond', from: post.ID}} %} {% set muzieknummers = mb.get_posts( args2 ) %} {% set counter = 0 %} {% for muziek in muzieknummers %} {% set counter = counter +1 %} {% set post2 = mb.get_post( muziek.ID ) %} <p><a href="{{ post2.url }}">{{ post2.post_title }}</a></p> {% endfor %} {% if counter == 0 %} Er is nog geen muziek voor deze avond vastgelegd. - no music yet - {% endif %} <hr /> {% endfor %}Here is a short video of all settings involved: https://drive.google.com/file/d/1Ok9HploeRIkomw7uukIa7cuikxAFH1gN/view?usp=drive_link
Regards,
EddyEddyPiV
ParticipantThanks Peter, you pointed me in the right direction. It's working now.
EddyPiV
ParticipantThanks Peter.
I noticed that in the first attempt I had set the post type to courses, instead of course. That was it.
I expanded the code to show thumbnail and post title. That worked nicely.
Then I added the condition to show only for coursecategory = training, that's where I step into a critical error.{% set args = {post_type: 'course', nopaging: true, relationship: {id: 'student-results', from: user.ID}} %} {% set courses = mb.get_posts( args ) %} <div class="completed_courses"> {% for course in courses %} {% set coursecategory = mb.get_the_term_list( result.ID, 'coursecategory', '', ', ' ) %} {% if coursecategory is 'training' %} <div class="course"> {% set post = mb.get_post( result.ID ) %} {{ mb.get_the_post_thumbnail( result.ID, 'thumbnail' ) }} <p style="text-align: center;"><strong>{{ post.post_title }}</strong></p> </div> {% endif %} {% endfor %} </div>Hopefully you can help me here?
Thanks!July 26, 2024 at 1:31 PM in reply to: ✅How to display post contents in a list in a way respecting the paragraphs? #46015EddyPiV
ParticipantThanks Peter for sharing this link re the first point.
Re point 2: No, there are no <p> and </p>'s. I know that this will result in proper showing, but the users are 'simple minds' and I don't want to bother with adding this to their text. So they just enter the text in the (classic) Visual editor.
But now it shows as a concatenation of words, all on 1-2 lines.For this case I'll fall back to the display-posts plugin that handles it out of the box and also respects <!--more-->.
Thanks for your help.
July 24, 2024 at 11:51 PM in reply to: ✅Frontend data submission not saved for user role subscriber #45998EddyPiV
ParticipantI had set up the custom fields in a way that they were only visible in admin area to the Admin role, and let users edit in the frontend. But perhaps that's a conflicting idea?
I did many tests, and probably confused myself when I said the user could edit in admin area and not in frontend.
Anyway, I have now removed the setting that fields are only visible for the Admin role.
Now visible to the user and user can edit in the frontend.So consider it solved.
Thanks Peter
EddyPiV
ParticipantThanks Peter. Fully makes sense, I just didn't think of it myself.
EddyPiV
ParticipantI found it already, and expanded the code to my liking.
December 19, 2023 at 10:17 PM in reply to: ✅download button acts differently when triggered through field vs when hardcoded #44143EddyPiV
ParticipantPeter, the audio was file type URL.
I tried various scenarios, and with File Input it works properly. That file type fits perfectly, as all music is already in the media library.So thanks for your help.
December 4, 2023 at 11:04 PM in reply to: ✅504 Gateway Time out on every update action on a cpt #44010EddyPiV
ParticipantPeter, it happens only with 1 specific cpt, all other post types are working properly.
But you're actually right, it's caused by another plugin. Deactivating it solved it.
I'll contact them to act on the errors in the debug.log.Thanks.
EddyPiV
ParticipantThanks Peter, all fine now.
EddyPiV
ParticipantHi Peter, thanks, that almost works.
It just, if post.fan_profile is empty, then the value of the most recent occurrence is returned.
How to avoid that?EddyPiV
ParticipantJust to add, to demonstrate that {{ spending_post.amount }} is correct: I tested by taking out
name: '{{ post.fan_profile }}', and the amount was shown for each fan.November 28, 2023 at 4:41 AM in reply to: ✅The relationship in View thru Shortcode doesn't get shown #43952EddyPiV
ParticipantHi Peter,
With your help I managed to get it working.
Thanks a lot, regards.
November 8, 2023 at 12:35 AM in reply to: ✅How to show the number of published posts of a post type? #43765EddyPiV
ParticipantThanks a ton, Peter.
Works nicely!EddyPiV
ParticipantFound it, I saw this thread: https://support.metabox.io/topic/custom-field-content-no-longer-editable-viewable-in-wordpress-admin-area
-
AuthorPosts