Fundraiser front page view

Hello there!

Thank you again for the last support! It worked perfectly!

Quick question, I'm trying to find a way to add a project view from the home page by including project stats ( backers, goal, etc) using the shortcode.

From my main site, I did (using Upfront)

1) Add a "Posts" elements by dragging it to my area
2) Chose Single Post, Custom Post and selected Projects as Post Type.
3) I can see the project nicely and can re-order elements which is great.

I tried adding the shortcode into the project description at the top so I can see progress bar as well

[progress_bar id="1613" show_title="yes" show_totals="yes" style="wdf-fresh"]

But the progress bar doesn't showed up.

My question will be.. How can I display the number of backers and goal into the project view (home page)... similar to all those kickstarter, indiegogo main page view ?

I tried adding a project panel as well ( 2nd window from my home page), but the title is not clickable and I don't seem to find a way to add/control the actual project content and I don't want to have the reward/donation panel displayed...

I like the first project view (1st column) since I can control the number of characters to display as content and display more information (categories, authors, etc).

I would like to simply add a code to display the number of backers, goal and that nice rolling progress bar... is that possible?

Thank you very much for your great support as always!

Regards

  • Predrag Dubajic

    Hey Stephane,

    Hope you had a nice weekend

    Upfront will show excerpt by default and that strips out the shortcodes so if you add them to content they will be removed from Posts element.

    What you can do is place Text element above/below your posts element and then add the shortcode there, that way the shortcode will render properly on your home page.

    Would this work for you?

    Best regards,
    Predrag

  • Stephane

    Hi Predrag,

    That's great! I can add a text element with the shortcode and does work! Thank you very much!
    I have two quick question related to the same topic if I may ask.

    The progress bar is great, I can modify it...

    1) The fundraiser panel -> is there a way to hide the pledge options. I will like to display only the backers, amount raised and goal. No reward/pledge elements. Maybe through CSS coding(display:none) ?

    2) In Joomla, there a plugin (tabulizer) that allows me to execute a sql query to retrieve a specific value from the database and display it. Is there something equivalent in WP or your plugins which I can retrieve the number of backers (or any other strings) using a sql query and display it where I want?

    Example:

    Number of Backers: [tabulizer get_value_from_db] supporters!

    Thank you again for your great support! I truly appreciate it!

    Regards

  • Predrag Dubajic

    Hi Stephane, apologies for the delay here.

    1) The fundraiser panel -> is there a way to hide the pledge options. I will like to display only the backers, amount raised and goal. No reward/pledge elements. Maybe through CSS coding(display:none) ?

    When you create/edit your fundraising you have an option to disable rewards and this will hide those elements from your fundraising.
    Is that what you wanted to do?

    2) In Joomla, there a plugin (tabulizer) that allows me to execute a sql query to retrieve a specific value from the database and display it. Is there something equivalent in WP or your plugins which I can retrieve the number of backers (or any other strings) using a sql query and display it where I want?

    I'm afraid that I'm not familiar with a plugin that could do that but perhaps this could work for you.
    Add below code to your child theme functions.php or create mu-plugin for it:

    function num_of_backers( $atts ) {
    	$atts = shortcode_atts(
    		array(
    			'post_id' => '1,2',
    		),
    		$atts
    	);
    	$backer_total = wdf_total_backers(false, $atts['post_id']);
    
    	return 'Number of Backers: '.$backer_total.' supporters!';
    }
    add_shortcode( 'number_of_backers', 'num_of_backers' );

    Now you can add this shortcode [number_of_backers] to show number of all backers or this one [number_of_backers post_id="XX"] to show number of backers for specific fundraiser where XX will be ID of your fundraiser.

    Best regards,
    Predrag