jaggreene
Forum Replies Created
-
Forum: Plugins
In reply to: [Gravity Forms + Stripe] Gravity Forms Stripe Time-Based SalesQuick update.
I have cobbled together the following code that I think will do what I want. test key has been changed to a random value.
I use a value in custom field suite plugin meta box on the post.
When the value is set to 1 the page disappears.
When it is zero pages stays live.
the problem is I am not sure where to put the code. Because when I add it to theme functions.php it says fatal error called to undefined function add_action()
Forum: Plugins
In reply to: [Buy Now for Stripe] PHP Echo Do_Shortcode doesnt workHi cartpauj,
Without do_shortcode, how do we include a buy now button in a template?
Hi,
Any help on this would be appreciated
Forum: Fixing WordPress
In reply to: Display posts with categoriesHi,
(I can’t seem to edit the above post, so I reposting properly to comply with forum rules)
I used the forum search for this particular problem and provided a great solution except for one problem.
Essentially what I want to do is when someone views the tag page, I want to display the posts that have that tag.
I want the posts to be sorted by what category they are in though.
The code snippet I am using is
I placed it within the <?php while ( have_posts() ) : the_post(); ?> loop. The problem is outputs the posts that have the matching tag underneath of every category on the site. Even though the posts may not be in those categories.
To see an example go to
https://www.higherthinkingtv.com/tag/india/I had the category code before the while loop, but I noticed it was not displaying properly
Here is the entire code for the loop and the attempted category addition.
Thanks,
Hi,
thanks for the code. $mostpopular just shows up blank instead of displaying the week’s video posts.
I think my best option now is to just have an html notice when $mostpopular is blank directing them to a search page.
I had
if ( !is_array($mostpopular) || empty($mostpopular) ) { $content .= "<p><a href=\"/videos\">".__('Looking for videos? Click here', 'wordpress-popular-posts')."</a></p>"."\n"; }
I also tried
if ( !is_array($mostpopular) || empty($mostpopular) ) { $mostpopular .= "<p><a href=\"/videos\">".__('Looking for videos? Click here', 'wordpress-popular-posts')."</a></p>"."\n"; }
neither seemed to work
Hi Hector,
Thanks for the answer.
How do I change the above code then to show the most popular posts from the week (instead of yesterday) when $mostpopular is empty?
Thanks!
That worked well!
Hi,
Thanks for the code. It works except for daily range.
I copied the code, but when I had it as just
onMouseOver="setpage(\'$t',
It gave me a output like
setpage('$t<span class=
So I changed
onMouseOver="setpage(\'$t',
to
onMouseOver="setpage(\''.$t.'\',
but for the daily instance it comes out as thumb2.
Here is my full code
$t = ($instance['range'] == "daily") ? 'thumb1' : ($instance['range'] == "weekly") ? 'thumb2' : 'thumb3'; $data = array( 'title' => '<a href="'.get_permalink($wppost->ID).'" title="'. $title_attr .'" onMouseOver="setpage(\''.$t.'\', \''.get_permalink($wppost->ID).'\', \''.get_video_thumbnail($wppost->ID).'\')"><span class="wpp-post-title">'. $tit .'</span></a>', 'summary' => $post_content, 'stats' => $stats, 'img' => $thumb, 'id' => $wppost->ID, 'posttime' => '<span class="wpp-post-time"> (\''.get_field('video_time', $wppost->ID).'\')</span>', 'jcode' => 'setpage(\''.$t.'\', \''.get_permalink($wppost->ID).'\', \''.get_video_thumbnail($wppost->ID).'\')' );