-
AuthorPosts
-
June 1, 2024 at 3:10 pm #1447285
Hi;
i am using the blog as news page. The setting is 3 news in row in raster format as usual setting.
Would it be possible to place a news per row?
[images ] [headline + text + link]It should looks like here: https://evelyn-kuehne.de/aktuelles/
- This topic was modified 5 months, 3 weeks ago by xeovision.
June 2, 2024 at 12:47 am #1447394Hey Sebastian,
By raster do you mean grid?
That would be very tricky to overwrite, and our list style doesn’t have images, I believe the best option would be to use a plugin for list style posts, and add it’s shortcode to the page.Best regards,
MikeJune 4, 2024 at 8:29 pm #1448192Hi .. good idea, so i did setup a plugin for such view .. it works like expected.
BUT – it is always a but :) … i using the blog system for news and also products.Display on 2 different pages, page NEWS shows news the category A and PRODUCT page shows the category B.
This works fine.
The problem is now, that on the blog news single page i have added the area block from page NEWS .. so this NEWS block comes also on the page with PRODUCTS .. this shows a wrong headline now .. is here an option so add in functions that differse inbetween both pages?If page NEWS show area 1
If page PRODUCTS show area 2
?June 6, 2024 at 11:28 am #1448526Hi,
Thanks for the lin to your pages, but when I check the heading for each seems to be correct.
Please explain the issue further and perhaps a screenshot would help.Best regards,
MikeJune 6, 2024 at 11:50 am #1448530Yes but you see the same head area “Veranstaltungen” on both sides. So the text does not fit to the Books page.
Sure the reason is that i use the blog for 2 different contents.So i need a workaround in function.php that display different header area in “Veranstaltungen” and “Books” .. maybe controlled by the page ID?
It is difficult to describe, but see the area block (brown with with H1) and open an event. On new browser window open a Book description, you see that both has the same header with content and headline from Veranstaltungen because we defined it in the function.php that this one should be shown on single blog event. This is bcs i use Veranstaltunge AND books as blog pages.
- This reply was modified 5 months, 2 weeks ago by xeovision.
June 6, 2024 at 12:05 pm #1448533Hi,
When I check only one is Veranstaltungen, the other is Lesestoff entdecken, and both of these are built into your page and not from your functions.php code, so you can change this directly in your page instead of your functions.php Please see the screenshot in the Private Content area of what I see.Best regards,
MikeJune 6, 2024 at 12:14 pm #1448535I have record it as short clip for better understanding
June 6, 2024 at 10:22 pm #1448570Hi,
Ok thank you, I understand better now 🙂, but your site has changed since that video, Lesestoff entdecken is not a menu option now.
So I try to adjust this with the menu item Buchtipps I hope that I understand correctly.
So the items under Buchtipps so header of Veranstaltungen, so basically your Veranstaltungen is built-in:
you can create a difficult code based on the category:
So please try adjusting thisBest regards,
MikeJune 7, 2024 at 11:55 am #1448608Thanks, that might be the way, seletive header by category .. but how should it looks like?
if(get_post_type( $post_id ) == “post” || is_archive() || is_category()) {
?- This reply was modified 5 months, 2 weeks ago by xeovision.
June 7, 2024 at 4:47 pm #1448618Hi,
if(get_post_type( $post_id ) == "post" || is_archive('xxx'))
xxx is the category ID number
your original code has is_archive() || is_category() but is_archive() covers is_category() so you should not need both, then add the category IDBest regards,
MikeJune 7, 2024 at 10:02 pm #1448638hmmm…something will not work like you wrote :)
I add 2 header areas and gave each a differen page ID .. so far so fine but i could not save it and get always this error
Cannot redeclare ava_after_main_title_mod() (previously declared in wp-content/themes/enfold-child/functions.php:63)/* area img on archive Events
add_action('ava_after_main_title', 'ava_after_main_title_mod'); function ava_after_main_title_mod() { $post_id = get_the_ID(); if(get_post_type( $post_id ) == "post" || is_archive('3658')) { echo 'xxxxcontentxxxxx'; } }
/* area img on archive Bücher
add_action('ava_after_main_title', 'ava_after_main_title_mod'); function ava_after_main_title_mod() { $post_id = get_the_ID(); if(get_post_type( $post_id ) == "post" || is_archive('3443')) { echo 'xxxxcontent-2xxxxx'; } }
Whats wrong here?
June 7, 2024 at 10:10 pm #1448641Hi,
You can’t redeclare ava_after_main_title_mod(), so you need to rename it like this:
the first one:add_action('ava_after_main_title', 'ava_after_main_title_one'); function ava_after_main_title_one() { $post_id = get_the_ID(); if(get_post_type( $post_id ) == "post" || is_archive('3658')) { echo 'xxxxcontentxxxxx'; } }
then the next one:
add_action('ava_after_main_title', 'ava_after_main_title_two'); function ava_after_main_title_two() { $post_id = get_the_ID(); if(get_post_type( $post_id ) == "post" || is_archive('3443')) { echo 'xxxxcontent-2xxxxx'; } }
Best regards,
MikeJune 7, 2024 at 10:25 pm #1448644ahh .. ok, now, i can save it.
Both different header are shown. So, now i need to make the opposite invisible… I thought it will be only ony dispayled when using unique IDsJune 8, 2024 at 12:48 pm #1448677I have seen your change MIKE
add_action('ava_after_main_title', 'ava_after_main_title_one'); function ava_after_main_title_one() { $post_id = get_the_ID(); if(get_post_type( $post_id ) == "post" && has_category('veranstaltungen')) {
Pretty cool .. many many thanks
…so i am glad and we can close here
June 8, 2024 at 12:50 pm #1448678Hi,
I see that both 3658 & 3443 are post IDs, I thought that you wanted to use the category IDs so that you could set this for each category instead of creating an array of post IDs
So I changed it like this using the category slugs instead of the IDs so it will be easier to read:if(get_post_type( $post_id ) == "post" && has_category('veranstaltungen')) {
and
if(get_post_type( $post_id ) == "post" && has_category('buecher')) {
and this seems to be working correctly, please check.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.