Hello
I was wondering if you could be so kind to help me. If you look at my home page at (no spaces)
p a r a d i s e f o u n d t o u r s. c o m
I added a custom “blurb” using Advanced Custom Fields. For the life of me I couldn’t figure out a different way (block quotes? I don’t know)
What I did was edit:
includes/modules/td_module_1.php <-archives
includes/modules/td_module_2.php <- home page categories
includes/modules/td_module_3.php <- home page featured.
I added this code:
<!-- Start of Custom Blurb on Archive Tour Page Categories -->
<p class="blurb"><?php the_field('tour_blurb', $this->post->ID); ?></p>
<!--/post-title - price class added -->
<div class="retailprice">Retail Price: $<?php the_field('retail_price', $this->post->ID); ?></div>
<div class="price">Our Price: $<?php the_field('price', $this->post->ID); ?> USD</div>
<div class="disclaimer">*No additional fees or taxes on checkout!</div>
<!-- End of Custom Blurb on Archive Tour Page Categories -->
And I removed the exerpt code from td_module_2.php
The problem that I am now having is the code shows up when I try to add block 3 or block 5 to the sidebar using a widget. http://www.screencast.com/t/3lDYWcVNk
Could you please spare an if statement? That just shows this code on td_module_1.php, td_module_2.php td_module_3.php and NOT in the blocks within the sidebar widget, is that possible?
Thank you so much
Hi,
A solution may be to pass a parameter to the render method – http://screencast.com/t/nQeTY7eNdaJ
And create a condition so that the added code doesn’t display on blocks, ex – http://screencast.com/t/Rp9rt4WEI
Thank you!
Hi,
Did you tried Emil solution for this?
Unfortunately we are not available for custom services, we can only provide some suggestions so if you don’t have php experience I suggest to get someone to help you.
Thanks!
Alin, I assumed Emil’s example was a suggestion that he wanted me to add my own code on it, I don’t know code. I was hoping for an example piece of code that was proven to work. I don’t know what he wants me to fill in for “my custom code” don’t know what he want me to do with the code in the screencast, there was no instructions, but a screen snap of code… do i use that code? do i paste that code somewhere as is? Do i need to modify it?
All i want to do is stop that code from showing up on the widget blocks, surely someone must have an easy fix? an if statement maybe?
Please?
Hello,
Unfortunately there is no code we can provide to copy and paste, Emil suggested you replicate the code highlighted. He suggested you disable the post render parameter. This is the original code: http://screencast.com/t/3LnE9tQcTkwh compare it to the example Emil provided.
For the second one, again: this is the original: http://screencast.com/t/zDpDvCaINWB. Replicate what Emil has done. He provided the solution.
Thank you!
Bogdan, Alin
I appreciate the suggestion but it’s not clear to me on some things.
td_module_1.php line 10 $parameter = ''
Do i just leave the ‘ ‘ or am i to put something between those ‘ ‘ ?
and line 21 echo 'my custom code';
Am i to leave it as ‘my custom code’ or am i to put something in there to replace ‘my custom code’ and if yes, what would i put in there?
Thanks so much.
-
This reply was modified 10 years by
mboydnv.
Hi
You don’t have to put any value for the $parameter That it’s an empty variable with a conditional role, meaning that if the module it’s used within a block the code between if statement won’t be executed: http://screencast.com/t/nQeTY7eNdaJ
On line 21 you have to replace 'my custom code' with your custom code. This code won’t be displayed, on blocks, only on modules because of the $parameter variable: http://screencast.com/t/nQeTY7eNdaJ
Please consider that this is a complex task which require good coding skills and if you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you as we can’t offer any type of custom work at the moment.
Thanks!
