Forum Replies Created
-
AuthorPosts
-
EddyPiV
ParticipantFound it. Resolved.
EddyPiV
ParticipantYes, that was it. The format mistake I already figured out.
Thanks, let's close this thread.EddyPiV
ParticipantThat indeed resolves the critical error.
And some new questions arise...
Question 1:
There are 2 posts found, 1 with date today, 1 with date 3 days ago.
Yet, the post.date for both (according to the view) are shown as today. Why is that???
Print of database: https://share.getcloudapp.com/X6uN152L
Result of the View: https://share.getcloudapp.com/L1uJA65q
The View-code: https://share.getcloudapp.com/xQuL2Og7Question 2:
At least 1 post should be displayed with its details, but there are no posts displayed.
Considering the post.date for both showing today, both should be displayed.
Why are no posts displayed?
Something with stored formats? How to formulate the condition correct?EddyPiV
ParticipantHi,
I know, the devil is in the details... I should have added the mb. prefix...
But it doesn't resolve the critical error.Deleting the "if" construction avoids the critical error, so it is really in this statement.
EddyPiV
ParticipantActually, I found out that what I wanted to do wouldn't work: I was trying to set the expiration date fields of the Post Expirator plugin, but there is more needed to get it to work, probably setting a cron job.
So my question is now a bit different.
I am now skipping the posts that are older than 24 hours.I included this if statement: {% if {{ post.date }} > strtotime('-1 day') %},
but WordPress didn't like it... critical error on the website.Here is the view: https://share.getcloudapp.com/RBuOpJkA
EddyPiV
ParticipantHi,
To me is doesn't make sense to define multiple taxonomies for actually the same thing, with all having the same items.
Anyway, I tried your approach and it indeed showed the pagination link, but also in case it shouldn't.
For one type I had only 3 instances, these were shown, plus the Next link.
Pressing that next link told me that there were 14 posts, and the last 4 were shown. So it looks like it thought it had shown 10 occurrences on the previous page...Whatever, it introduced new questions, and I have the feeling that I take 2 steps back again, while I am so close.
My decision is to stay with 1 taxonomy and with your solution for the custom pages based on get-posts, with a larger number of posts to show, and forget the pagination.
This works, looks nice, and I expect it will be acceptable to the client.Thanks a lot for your patience and help.
Let's close this thread.EddyPiV
ParticipantHi,
That's what I meant when I said that for me the coding is more difficult for Custom views than for the Archive views. In the archive views we have the {{ mb.get_the_posts_navigation() }} function, but that doesn't work for the custom view.
I have puzzled many hours to get this figured out for the custom view, but without success. All the time I get "critical error on my website" message.Isn't there any help to get this easier supported for custom view??
EddyPiV
ParticipantThanks Long.
It works. I have managed to further adjust it to my liking.
Except for the pagination, that doesn't work, no paging is shown. Any light on that?EddyPiV
ParticipantThat I understand, and I did that before. But I got stuck on the coding, as I didn't manage to get the post link and the featured image of the post. That's what I meant when I said that the coding is more difficult for me in this approach.
So perhaps you can help me with the correct code for getting the post link and the post featured image?
EddyPiV
ParticipantHi Long,
There is now 1 view of a Custom Type. As the coding for custom type is harder for me to understand/specify, I prefer to use an Archive Type.
Your comment on various views of Archive Type causing problems confuses me. It's a bit as I mentioned earlier: I don't understand the relation between the Archive Location settings and the url it relates to.
E.g. I need different archive-views for ../location/amsterdam/?post_type=post and ../location/amsterdam/?post_type=event, and for ../location/rotterdam/?post_type=post
How to define that in the Archive Location settings?My problem was that my View seemed to be ignored, perhaps because my Archive Location settings were incorrect.
EddyPiV
ParticipantI have done that, but still the view seems ignored: all posts, pages and cpt’s for this value of the taxonomy are shown, and the initial text “This is the archive view” does not appear.
EddyPiV
ParticipantActually, I believe I don't understand how the location works in relation to the url of the acrchive page.
Just a simple location is okay, but once it gets more (AND / OR relations) I am lost.
Although in the case above, even with a single condition it already seems ignored...
So if you please could elaborate...EddyPiV
ParticipantHi,
I am confused, I still couldn't figure out how to get all posts for a specific value of a taxonomy.
It looks like my view is ignored at all.This is the view: https://share.getcloudapp.com/12uJlQwX
This is the location: https://share.getcloudapp.com/Z4ukNpQ8,
This is the value for the taxonomy: https://share.getcloudapp.com/RBuOAkKL
This is the result: https://share.getcloudapp.com/nOuk7JBw
It shows just all posts, pages and cpt's for this value of the taxonomy. Also, the initial text "This is the archive view" does not appear.Your help is much appreciated...
EddyPiV
ParticipantOkay, that clarifies that part.
Then I proceed with the Custom view, and I will include the shortcode.
I have adapted the view according to your advise, but it seems it finds no records: I get 5 items, each without title, excerpt etc, but all with the current date & time.
https://share.getcloudapp.com/YEuozDmvSeptember 3, 2020 at 5:30 PM in reply to: ✅How to assign a value to a taxonomy without showing it in the form in front-end? #21621EddyPiV
ParticipantHi Long,
Excellent, now it's all working!
Thanks so much for your help.
-
AuthorPosts