Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Asgaros

    (@asgaros)

    Hello zeldior,

    the Widget can be added to your site via the WordPress administration interface in Appearance -> Widgets. Do you need a shortcode for it?

    Thread Starter zeldior

    (@zeldior)

    I Would add the June page of the Divi via text module via a shortcode

    Plugin Author Asgaros

    (@asgaros)

    Add this code to your themes functions.php file:

    add_shortcode( 'widget', 'my_widget_shortcode' );
    	function my_widget_shortcode( $atts ) {
    
    	// Configure defaults and extract the attributes into variables
    	extract( shortcode_atts(
    		array(
    			'type'  => '',
    			'title' => '',
    		),
    		$atts
    	));
    
    	$args = array(
    		'before_widget' => '<div class="box widget">',
    		'after_widget'  => '</div>',
    		'before_title'  => '<div class="widget-title">',
    		'after_title'   => '</div>',
    	);
    
    	ob_start();
    	the_widget( $type, $atts, $args );
    	$output = ob_get_clean();
    
    	return $output;
    }

    After that you can add the Asgaros Forum Recent Posts-Widget in every page/post with the following shortcode:

    [widget type="AsgarosForumRecentPosts_Widget" title="My Title"]

    Plugin Author Asgaros

    (@asgaros)

    I forgot something in the shortcode. Here is the correct example:

    [widget type="AsgarosForumRecentPosts_Widget" title="My Title" number="2" target="1281"]

    title: The title
    number: Number of replys
    target: The ID of the forum page

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Recent Forum Posts Widget’ is closed to new replies.