I’m trying to add a widget area to the main events page and to individual event pages, via functions.php
For the main events page I’m using “if ( is_post_type_archive( ‘tribe_events’ )”
What would I use to target a single event, please?
Thanks
Dom
Is it possible to include multiple keywords in “contains” parameter of an if statement?
Here’s the example that is provided in documentation: [if field=title,content contains='some keywords']
Can I have something like? [if field=title,content contains='.mp3, .mp4']
That way I can test scenarios like if a url entered contains a .mp4 or .mp3. I’ve tried tweaking the short-code in many different ways, but not getting any luck.
Can you please advise?
Thanks,
Kendell
I’ve created a form with a few dependencies for 2 dropdowns (Please see form on page linked).
For some reason, it does not show the final calculated value.
Not sure if somehow you can see the code added in the form in the backend or whether I need to provide the code somehow.
Please advise
Thanks
For example the default text site-wide is “Leave a Reply”. But for some specific pages only, I want the text to read “Leave a Review”.
Is there some code I could use in the comments.php file that would make this work?
]]>This is what I got so far, any suggestions, corrections, or help would be greatly appreciated!
a)
Condition:
If one person household (fieldname16), with NO finance plan (fieldname20), annual income is less than $15,000 (fieldname 2) and monetary assets is less than $3000 (fieldname 3) = value is 7000
Code:
if(fieldname16 < 2 && fieldname20 == No && fieldname2 < 15000 && fieldname3 < 3000) return 7000;
b)
Condition:
If one person household, with a finance plan, annual income is less than $15,000 and monetary assets is less than $3000 assets = value is 8400
Code:
if(fieldname16 < 2 && fieldname20 == Yes && fieldname2 < 15000 && fieldname3 < 3000) return 8400;
c)
Condition:
If one person household, with NO finance plan, annual income is between $15,000 and $35000, monetary assets is less than $3000 assets = value is 9000
Code:
if(fieldname16 < 2 && fieldname20 == No && fieldname2 >= 15000 && fieldname2 <=35000 && fieldname3 < 6000) return 9000;
d)
Condition:
If one person household, with a finance plan, annual income is between $15,000 and $35000, monetary assets is less than $3000 assets = value is 10800
Code:
if(fieldname16 < 2 && fieldname20 == Yes && fieldname2 >= 15000 && fieldname2 <=35000 && fieldname3 < 6000) return 10800;
e)
Condition:
If one person household, with NO finance plan, annual income is more than $35,000, monetary assets is less than $3000 assets = value is 11000
Code:
if(fieldname16 < 2 && fieldname20 == No && fieldname2 < 35000 && fieldname3 < 3000) return 11000;
f)
Condition:
If one person household, with a finance plan, annual income is more than $35,000, monetary assets is less than $3000 assets = value is 13200
Code:
if(fieldname16 < 2 && fieldname20 == Yes && fieldname2 < 35000 && fieldname3 < 3000) return 13200;
g)
Condition:
If married or two person household, with NO finance plan, annual income is less than $25000 and monetary assets is less than $5000 assets = value is 7000
Code:
if(fieldname16 > 1 && fieldname ==Yes fieldname20 == No && fieldname2 < 25000 && fieldname3 < 5000) return 7000;
h)
Condition:
If married or two person household, with a finance plan, annual income is less than $25000 and monetary assets is less than $5000 assets = value is 8400
Code:
if(fieldname15 == Married || fieldname16 > 1 && fieldname20 == Yes && fieldname2 < 25000 && fieldname3 < 5000) return 7000;
i)
Condition:
If married or two person household, with NO finance plan, annual income is between $25000 and $50000, monetary assets is less than $10000 assets = value is 9000
Code:
if(fieldname15 == Married || fieldname16 > 1 && fieldname20 == No && fieldname2 >= 25000 && fieldname2 <= 50000 && fieldname3 < 5000) return 9000;
j)
Condition:
If married or two person household, with a finance plan, annual income is between $25000 and $50000, monetary assets is less than $10000 assets = value is 10800
Code:
if(fieldname15 == Married || fieldname16 > 1 && fieldname20 == Yes && fieldname2 >= 25000 && fieldname2 <= 50000 && fieldname3 < 10000) return 10800;
k)
Condition:
If married or two person household, with NO finance plan, annual income is more than $50000, monetary assets is more than $10000 assets = value is 11000
Code:
if(fieldname15 == Married || fieldname16 > 1 && fieldname20 == No && fieldname2 > 50000 && fieldname3 > 10000) return 11000;
l)
Condition:
If married or two person household, with a finance plan, annual income is more than $50000, monetary assets is more than $10000 assets = value is 13200
Code:
if(fieldname15 == Married || fieldname16 > 1 && fieldname20 == Yes && fieldname2 > 50000 && fieldname3 > 10000) return 13200;
**Objective: All in one Calculation so all conditions are met and a value is given to the user.
Thanks everybody!
]]>I would also like to be able to exclude parent and child links from select categories all together.
It would also be nice to include links to other child categories of the same parent. For instance I have Category A which has child categories A1 and A2. I would like to have a link on the A1 category page to A2 and a link to A1 on the A2 page. This however is of lowest priority.
Currently I am using this:
<!-- begin -->
<?php
//for this category on an archive page, get the ID
$thisID = get_query_var('cat');
$get_children_cats = array(
'child_of' => $thisID //get children of this parent using the thisID variable from earlier
);
//firstly, load data for your child category
$child = get_category($thisID);
//from your child category, grab parent ID
$parent = $child->parent;
//load object for parent category
$parent_name = get_category($parent);
//grab a category name
$parent_name = $parent_name->name;
echo '<strong><a href=" ' . get_category_link( $parent ) . ' ">' . $parent_name . '</a></strong><p>';
$child_cats = get_categories( $get_children_cats );//get children of this parent category
foreach( $child_cats as $child_cat ){
//for each child category, get the ID
$childID = $child_cat->cat_ID;
echo '<strong> - <a href=" ' . get_category_link( $childID ) . ' ">' . $child_cat->name . '</a></strong>';
} //end of categories logic
?><p>
<!-- end -->
This code does display the Parent and Child Category links but I would like to be able to include IF statements so I can have info like “Back To: <parent page link>” included ONLY on child pages and to be able to have text symbols appear between the child category links but NOT before or after the links (or not at all if there is only one child).
Unfortunately I don’t have enough programming or PHP to be successful with IF statements and would appreciate some advice.
]]>Here is my problem:
If the user inputs any number into the “Trunk circumference” field, then touches anything else in the form, it resets.
Trunk circumference code:
`(function(){
if(fieldname1 > 0) return prec(fieldname1*3.14,2);
})();`
The value only stays if the “Or, Trunk diameter” field is filled in. I need the value of the “Trunk circumference” to stay, if the user DOES NOT type anything into the “Or, Trunk diameter” field.
My goal:
Have the circumference calculated if the user enters in a diameter. If they don’t, then don’t do any calculations, and just use the inputted value of the circumference.
Help would be severely appreciated. Thank you
]]>global $post;
$args = array( 'post_id' => $post->ID );
$comment = get_comments( $args );
$user = wp_get_current_user();
if ( 3 <= count( $comment ) && $post->post_author == $user->ID) {
echo do_shortcode( '[button]' );
} else {
comment_form();
}
It basically stats that if there is less than 3 comments then show the comment form but if there is more than 3 and is the post author then show a button. The button shows but only if there are more than 3 comments. It doesn’t check if it is only the post author or not, like i want it to.
]]>Given the following:
<?php masterslider(“featured-posts”); ?>
..how would I construct the if statement?
Many thanks in advance
https://www.ads-software.com/plugins/master-slider/
]]>I’m trying to modify the following if statement with the output from the get_theme_mod but having no luck, the current one I’m using is:
<?php if( $thePriority_settings[‘social_title’] != ” ) : ?>
<?php
echo $thePriority_settings[‘socialTitle’];
?>
<?php endif; ?>
how do I change it to look for the control output socialTitle in my customizer?
cheers
Geof
]]>