• Resolved Wouter Vellekoop

    (@dowodesign)


    Hé Man,

    Great plugin!

    Maybe you can help me with a problem, I’m trying to implement the code in to a plugin. but I can’t get it to work. Do you have any tips?

    function generate_art_title($i) {
    	 	$art_title = '';
    	 	$art_ID = '';
    	 	$art_url = '';
    
    	 	if($this->wdgt_config['data_source_type'] == 'custom') {
    	 		$art_title = $this->wdgt_results[0][$i]->post_title;
    	 		$art_ID = $this->wdgt_results[0][$i]->ID;
    	 	} else {
    	 		$art_title = $this->wdgt_results[$i]->post_title;
    	 		$art_ID = $this->wdgt_results[$i]->ID;
    	 	}
    
    	 	$art_url = get_permalink($art_ID);
    	 	$art_title_short = $this->cut_text('article_title', $art_title);
    
    	 	$output = '<h3 class="gk-nsp-header"><a href="'.$art_url.'" title="'.str_replace('"','', $art_title).'">'.$art_title_short.'</a></h3>';
    
    	 	return apply_filters('gk_nsp_art_title', $output);
    	 }

    I want the H3 to be replaced with the secondary title, I tried all sorts of things..

    So something like;

    <h3 class="gk-nsp-header"><a href="'.$art_url.'" title="'.str_replace('"','', $secondary_title).'">'.$secondary_title.'</a></h3>
Viewing 1 replies (of 1 total)
  • Plugin Author thaikolja

    (@thaikolja)

    I’d love to help you but it’d be a lot easier if you could describe in a few sentences what you’d like to do. The code excerpt is not that easy to understand with all that variables I can’t trace back.

    Secondary Title only works in widgets if you deactivate the function “Only show in main posts” on the settings page. After that you should be able to use the secondary title in the widget as you’d anywhere else.

Viewing 1 replies (of 1 total)
  • The topic ‘Implement in Widget’ is closed to new replies.