• Salve utenti,
    sto utilizzando il Flexi Pages (http://wordpress.org/plugins/flexi-pages-widget/) che ti permette di visualizzare alcune pagina o sotto forma di lista o con un menù a cascata.

    Per la visualizzazione viene usata:

    $page_dropdown .= str_repeat("\t", $depth+1).'<option class="level-'.$level.'" value="'.$page['ID'].'"'.$selected.'>'.str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $level).$page['title'].$date.'</option>'."\n";

    Ho la necessità di tagliare il titolo della pagina perchè con il menù a tendità, la select esce fuori dal layout.

    Ho scritto la funzione e richiamato il titolo come:

    function taglia_stringa($stringa_in_input, $numero_caratteri){
    		if(strlen(trim($stringa_in_input))>$numero_caratteri){
    			$testo = substr($stringa_in_input,0,strpos($stringa_in_input,' ',$numero_caratteri)).'...';
    		} else {
    			$testo = $stringa_in_input;
    		}
    
    		return $testo;
    	}
    
    $page_dropdown .= str_repeat("\t", $depth+1).'<option class="level-'.$level.'" value="'.$page['ID'].'"'.$selected.'>'.str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $level).taglia_stringa($page['title'],26).$date.'</option>'."\n";

    Alcuni titoli li vedo, per altri invece vedo solo ‘…’ ma richiama comunque la pagina correttamente.

    Suggerimenti?

    Grazie.

Viewing 3 replies - 1 through 3 (of 3 total)
  • These are English language forums, so please use English. Alternatively, use a WP support forum in your language.

    Thread Starter robertosalemi

    (@robertosalemi)

    I’m sorry!

    – – – – –

    Hello users,
    I’m using the Flexi Pages (http://wordpress.org/plugins/flexi-pages-widget/) which allows you to view some page or in the form of a list or combo box list.

    The code for the display is:

    $page_dropdown .= str_repeat("\t", $depth+1).'
    <option class="level-'.$level.'" value="'.$page['ID'].'"'.$selected.'>'
    .str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $level).$page['title'].$date.
    '</option>'."\n";

    I need to cut the page title because with the drop-down menu, select the exit out of the layout.

    I wrote the function and called the title as:

    function taglia_stringa($stringa_in_input, $numero_caratteri){
    		if(strlen(trim($stringa_in_input))>$numero_caratteri){
    			$testo = substr($stringa_in_input,0,strpos($stringa_in_input,' ',$numero_caratteri)).'...';
    		} else {
    			$testo = $stringa_in_input;
    		}
    
    		return $testo;
    	}
    
    $page_dropdown .= str_repeat("\t", $depth+1).'
    <option class="level-'.$level.'" value="'.$page['ID'].'"'.$selected.'>'
    .str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $level).taglia_stringa($page['title'],26).$date.'
    </option>'."\n";

    Some titles I see them, for others I only see ‘…’.

    How can I fix?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘FlexiPages – Cut title page’ is closed to new replies.