Atilla Boz
Forum Replies Created
-
AuthorPosts
-
Ok thanks again, wrote him too. Let`s see what he says 🙂
Cheers,
AtillaAight, gonna try and post the new version.
Thx!
Oh okay… And yes it`s a clone of Supreme Theme.
Since it`s a child theme itself I could not build a child them myself.What about the Open Hours Widget?
Thx Stiofan 🙂
I have a feeling I have to change something over here, so the category link will also show up in the sidebar of the preview page:
`if ($preview || $page) {
$author_id = $post->post_author;
$author_name = get_the_author_meta(‘display_name’, $author_id);
$entry_author = get_avatar(get_the_author_meta(’email’, $author_id), 100);
$author_link = get_author_posts_url($author_id);
$post_type = $post->post_type;
$post_tax = $post_type . “category”;
$post_cats = $post->{$post_tax};
} else {
$author_name = get_the_author_meta(‘display_name’, $user_id);
$entry_author = get_avatar(get_the_author_meta(’email’, $user_id), 100);
$author_link = get_author_posts_url($user_id);
$post_type = $post->listing_type;
$post_tax = $post_type . “category”;
$post_cats = isset($post->post_category) ? $post->post_category[$post_tax] : $post->{$post_tax};
}`I tried the same that I did in the previous post and changed the first lines like this:
// if (!$preview) { if ($preview || $page) {
But it changed nothing. Any ideas anybody?
Thanks,
AtillaOk right now I found another thing… The number of the ratings is not shown on the preview page. But that is coded into the inc/georirectory-compatibility.php file of the theme.
I had to change it a little bit into this:
<?php $user_id = get_current_user_id(); $post_avgratings = geodir_get_post_rating($post->ID); $post_ratings = geodir_get_rating_stars($post_avgratings, $post->ID); ob_start(); // G2G mod: Not un-exlude the preview page from showing the rating counter // if (!$preview) { if ($preview || $page) { geodir_comments_number($post->rating_count); } else
Why is it coded like that? I guess it was the thought that when you add a listing and see the preview, nobody will have any ratings. But then the preview is still not correct, cause it should show at least That there are no ratings.
@paolo – would be cool, if that could be changed in one of the next updates 🙂 Or has it some special sense, that I could not see so far?
Man man, when I am done with this page, I will have 300% more knowledge in PHP, JS and CSS… Should have been ready in february and Im still working my ass off :/ Without your support I would have been so lost, so I have to thank all of you very much again for all your support and patience.
Cheers,
AtillaOk bit by bit I am getting the preview page to look like the normal listings pages.
Now I have 2 new questions:
1. How can I get the Open Hours get to show in the preview page sidebar, too?
2. Is it normal that the category link does not show up?Thanks in advance,
AtillaHi Stiofan,
thank you for the new snippet. I tested the code, for the normal detail page view it works. But in the preview page, the premium badge still wont show up. Checked the body classes, too and there is no “premium-eintrag” class.
Hmmm… is it maybe possible, just to deactivate the preview page? Would not be the best solution, but I dont know what else to do, right now.
What page? – Here:
https://wpgeodirectory.com/add-custom-body-classes-to-wordpress/Cheers,
AtillaJust saw this at the bottom of that documentary page:
foreach ( $classes as $key =&gt; $value ) {
under “Removing Body Classes” there was some encoding of something. You might want to correct that before somebody makes the copy&paste move with that code.
Cheers,
AtillaOn the homepage you can see a full width slider on top, and then another auto-sliding slider with only premium entries. If you click on “Travel Charme” for example you get here:
http://boz1.timmeserver.de/vz-locations/travel-charme-gothisches-haus/
Every premium listing has a little special, which is the little premium badge on the left of the title. You can see it right now if you get on the listing page. But on the preview page you cant.
And heres the direct link to the price packages:
http://boz1.timmeserver.de/wp-admin/admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_managerI hope the extra infos are helpful.
Thx again,
AtillaThis reply has been marked as private.Hi Stiofan,
thank you very much for coming up with another snippet. I tried a few different ways to fill the do something and the do something else areas. The first gave me a white page, the second “just” crashed the rest of the CSS.
I tried this one for example -I tried to mash up the older version and the new code you have sent but honestly I really dont understand the newest snippet. The old one made kind of sense to me and I could roughly understand what the lines were saying but this one is out of my skill scope 😉
Would be awesome if you could correct this mixture of codes:
// G2G Anpassung: diesmal über das Preis-Paket --> Für Premium Seiten und auch in preview nach Preispaket NEWSCHOOL if (geodir_is_page('detail')){ $package_id = isset($post->package_id) ? $post->package_id : ''; } elseif(geodir_is_page('preview')){ $package_id = isset($_POST['package_id']) ? $_POST['package_id'] : ''; if(!$package_id && isset($_POST['pid']) ){ $package_id = geodir_get_post_meta($_POST['pid'], 'package_id', true); } } if ($package_id==64 || $package_id==65 || $package_id=66 || $package_id==67 || $package_id==68 || $package_id==69 || $package_id==70 || $package_id==71 || $package_id==72 || $package_id==73 || $package_id==74 || $package_id==75 || $package_id=76 || $package_id==77 || $package_id==78 || $package_id==79 || $package_id==80) { add_filter('body_class','gd_price_custom_body_class'); function gd_price_custom_body_class($classes) { } $classes[] = 'premium-eintrag'; } else { // return the modified $classes array return $classes; }
But right now I have another idea, maybe that works out, too. Give me a minute…
Nope… could not get that to work neither… I tried to first add the class to the listing page and then on the preview page, if the price package ID is correct.
// G2G Anpassung: Body Class bei Einträgen erweitern diesmal über das Preis-Paket add_filter('body_class','gd_price_custom_body_class'); function gd_price_custom_body_class($classes) { global $post; if ( $post->package_id == 64 || $post->package_id == 65 || $post->package_id == 66 || $post->package_id == 67 || $post->package_id == 68 || $post->package_id == 69 || $post->package_id == 70 || $post->package_id == 71 || $post->package_id == 72 || $post->package_id == 73 || $post->package_id == 74 || $post->package_id == 75 || $post->package_id == 76 || $post->package_id == 77 || $post->package_id == 78 || $post->package_id == 79 || $post->package_id == 80 ) { $classes[] = 'premium-eintrag'; } else {} // return the modified $classes array return $classes; } // G2G Anpassung: Body Class bei Previews für Premium Einträge add_filter('body_class', 'gd_preview_custom_body_class'); function gd_preview_custom_body_class($classes) { global $post; if ( geodir_is_page('preview') && $post->package_id == 64 || $post->package_id == 65 || $post->package_id == 66 || $post->package_id === 67 || $post->package_id === 68 || $post->package_id === 69 || $post->package_id === 70 || $post->package_id === 71 || $post->package_id === 72 || $post->package_id === 73 || $post->package_id === 74 || $post->package_id === 75 || $post->package_id === 76 || $post->package_id === 77 || $post->package_id === 78 || $post->package_id === 79 || $post->package_id === 80 ) { $classes[] = 'premium-eintrag'; } else {} // return the modified $classes array return $classes; }
Any suggestions what I could do better, to make it work?
Thanks,
AtillaHi Stiofan!
to 1: that worked for me, looks much better now – thank you Stiofan!
add_filter('body_class','gd_price_custom_body_class'); function gd_price_custom_body_class($classes) { global $post; if ( $post->package_id == 64 || $post->package_id == 65 || $post->package_id == 66 || $post->package_id == 67 || $post->package_id == 68 || $post->package_id == 69 || $post->package_id == 70 || $post->package_id == 71 || $post->package_id == 72 || $post->package_id == 73 || $post->package_id == 74 || $post->package_id == 75 || $post->package_id == 76 || $post->package_id == 77 || $post->package_id == 78 || $post->package_id == 79 || $post->package_id == 80 ) { $classes[] = 'premium-eintrag'; } else {} // return the modified $classes array return $classes; }
to 2: I dont know what you exactly mean.
My actual problem is I need a class that will be shown:
A) In the normal page od of premium listing (what we have now)
b) And also on the preview page of the premium listing.Is that possible in any way with this new class we added to the price packages, or I would have to try to add the body class in a different way (maybe with adding it to the tags)?
Thank you,
AtillaHallo paolo,
thank you for the hint. I also found on that page, that it`s possible to add a body class based in the Tag. That way it would be more comfortable, because we have to add a special TAG “premium-slider” to each premium page. I tried it with this code but it did not work:
function my_custom_body_class_tag($classes) { // add 'my-class' only to the my-tag archive. if ( is_tag( 'premium-slider' ) ) $classes[] = 'superpremium'; // return the modified $classes array return $classes; } // add my custom class via body_class filter add_filter('body_class','my_custom_body_class_tag');
For now I made it like this, which is a bit long, cause I have many price packages, which are premium.
// G2G Anpassung: diesmal über das Preis-Paket -- > add extra custom class via body_class filter add_filter('body_class','gd_price_custom_body_class'); function gd_price_custom_body_class($classes) { global $post; if ( $post->package_id == 64) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 65) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 66) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 67) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 68) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 69) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 70) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 71) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 72) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 73) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 74) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 75) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 76) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 77) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 78) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 79) { $classes[] = 'premium-eintrag'; } elseif ( $post->package_id == 80) { $classes[] = 'premium-eintrag'; } else {} // return the modified $classes array return $classes; }
So my new questions would be:
1. Can I shorten this long code by adding the IDs in a line with commas?
2. Can I add that class also to the preview page? I guess in the preview page, there is no check for the price packages? Are the tags of the listing recognized when you open the preview page? Maybe it would work that way, cause I need the check both on the listing page itself AND on the preview page.Kind regards,
AtillaJuly 7, 2017 at 11:54 pm in reply to: Supreme Directory – Advances Search with additional infos #386078Hi Stiofan,
I had the category “Branchen” on the first place as placeholder with no listings in that CPT. So if somebody accidently chose no other category he would find an empty category page.
Now I added a “chose category” Text (in german) on left left of the form. Thought I had to add an additional span like the other guy used it but it worked out with only CSS, like you suggested.
Here is what I used and some extra lines in different monitor sizes:
.geodir-listing-search:before { background: url("/wp-content/themes/hochzeit-premium/images/suche-pfeil.svg") center center no-repeat; background-size: contain; content: ""; display: block; height: 35px; left: -30px; margin-top: 5px; position: absolute; top: 5%; width: 35px; transform: scaleX(-1); } #geodir_advanced_search-1:before { content: 'Branche wählen'; color: #fff; left: -100px; position: absolute; top: -20px; padding: 2px 10px; text-shadow: 1px 1px #000; }
Thanks again!
Atilla😀
Thanks for helping out and sending me on the right path again ! -
AuthorPosts