Home › Forum › Problemi Vari con WP › Nascondere titolo pagina in alcune pagine di wordpress
-
AutorePost
-
-
26 Gennaio 2012 alle 18:07 #20495ugougougoPartecipante
Salve a tutti, scrivo su questo forum perchè ho chiesto assistenza al creatore del tema che utilizzo per ilmio sito ma a quanto pare non sembra disposto ad aiutarmi, quindi mi rivolgo al forum di wordpress italy.
Non sono pratico di php e starei cercando una soluzione per poter nascondere, solo in alcune pagine del mio sito, il titolo della pagina stessa…
Mi spiego meglio: ho circa una decina di “sotto pagine” per le quali vorrei evitare di mostrare il titolo al pubblico.
Ho provato semplicemente cancellandolo nelle impostazioni delle pagine, tanto basta l’url del permalink perchè la pagina funzioni correttamente, ma non è una soluzione pratica se si vuole aggiornare le pagine…dato che nella lista pagine non appare nessun titolo!!!
Forse con del codice php si può risolvere la cosa in maniera corretta?
Quale file php dovrei modificare e con che codice?
Se qualcuno mi può aiutare pubblico il codice del file php da modificare. Grazie!
-
26 Gennaio 2012 alle 18:44 #92567Albert EinsteinPartecipante
Tu intendi togliere solo il titolo quando entri nella pagina giusto?
esempio, nella pagina di HOME: non vuoi veder visualizzato HOME, e cosଠvia, giusto?
-
26 Gennaio 2012 alle 21:51 #92571TittiModeratore
Intende il titolo delle pagine statiche
@kiinastudio se pubblichi codice usa Pastebin e limitati alla riga interessata e limitrofe
-
27 Gennaio 2012 alle 18:30 #92622Albert EinsteinPartecipante
Quindi? la soluzione qual’è? Perchè vorrei saperlo anchio come si toglie il titolo da una pagina statica.
-
27 Gennaio 2012 alle 18:31 #92623ugougougoPartecipante
@ Albert Einstein: Esattissimo, è proprio quello che devo fare
se pubblichi codice usa Pastebin e limitati alla riga interessata e limitrofe
ok seguo consiglio, non conocendo però php mi dovreste dare voi indicazioni per individuare le righe che interassano la visualizzazione del nome pagina, magari indicandomi qualche parola specifica o ricorrente per la visualizzazione dei titoli pagina.
Grazie!
-
27 Gennaio 2012 alle 18:49 #92625TittiModeratore
@ Einstein, kiina vuole una cosa diversa
La riga da togliere per non avere il titolo a tutte le pagine statiche è simile a questa:
<h2>†title=â€<?php the_title(); ?>â€><?php the_title(); ?></h2>
Ma è una domanda fatta 1000 volte e una ricerca sul forum o con google t’avrebbe dato la risposta
-
27 Gennaio 2012 alle 19:08 #92626ugougougoPartecipante
@ Titti: non a tutte solo ad alcune pagine, specificate magari come si come fa, da quanto ho capito, con le id post…Ovviamente qui non ci sono id…
Prima di postare ho fatto ricerca sia in italiano che inglese ma non ho trovato quello che cercavo quindi ho chiesto qui!
-
27 Gennaio 2012 alle 19:13 #92627TittiModeratore
@ Einstein, kiina vuole una cosa diversa
Ho risposto ad Einstein…
Se le risposte non si leggono è inutile continuare a rispondere
-
27 Gennaio 2012 alle 19:36 #92628ugougougoPartecipante
@ Titty: non ti seguo…Einsetein non ha detto ancora niente di specifico, tu mi pare hai segnalato un codice che nasconde TUTTI i titoli pagina, ma non devo nasconderli tutti, l’avevo segnalato all’inizio della discussione…Aspetto vs. parere…grazie
-
27 Gennaio 2012 alle 20:38 #92630TittiModeratore
1) Togliere il titolo solo a certe pagine
2) Togliere il titolo a tutte le pagine
3) Togliere il titolo solo alla pagina HOME
Son tre cose diverse e si fanno in modo diverso.
Einstein non si capisce cosa vuole e dovrebbe aprire un suo topic per spiegarlo. Se vuole la 2, la risposta l’ha già .
Tu vuoi la prima, e per questo t’ho detto che bisogna modificare il codice PHP che attualmente mostra i titoli delle pagine. T’ho dato indicazioni su come postare il codice per farti aiutare, ma non le hai seguite.
Dalla risposta che ho dato poi è ovvio cosa devi cercare… un codice con “title” simile a quello che ho dato nel file che gestisce le tue pagine statiche, probabilmente il page.php, ma dipende dal tema.
Quindi:
o pubblichi tramite Pastebin quel benedetto pezzo di codice che serve a chi ti deve aiutare, ma soprattutto serve a te per renderti conto di dove e come fare la modifica, oppure fai in un altro modo, molto più semplice, che ti consiglio:
Prima di tutto rimetti i titoli “normali” (quelli che dicevi di aver tolto) nelle tue pagine, che servono da mostrare nelle liste, nel menu, ecc.
Apri il file page.php e fanne una copia di sicurezza.
Togli la riga che mostra il titolo nelle pagine, la stessa di cui abbiamo già parlato, in genere è racchiusa dentro un tag <h>.
A questo punto non avrai i titoli in nessuna pagina, ma nelle pagine in cui ti interessa averli puoi aggiungerli tu manualmente nel corpo del testo, se le pagine non sono tante.
Scrivi il titolo che vuoi dare nella prima riga del testo, racchiudendolo tra i tag della misura che vuoi, tipo <h2>Titolo</h2>, o h3. E hai già finito, senza fare troppe modifiche di PHP.
-
27 Gennaio 2012 alle 23:25 #92633Albert EinsteinPartecipante
Eh già … titti ha ragione, colpa mia ho fatto confusione qua in mezzo!
Comunque a me interessava togliere solo la Home page, seguendo i tuoi consigli sono riuscito ad individuare il file e ho tolto il titolo a tutte le pagine.
E poi aggiunto il titolo direttamente dalla pagina stessa, come hai consigliato sempre tu, in modo molto pratico e veloce.
Ti ringrazio per l’aiuto, e spero che kiinastudio abbia risolto. ciao.
-
28 Gennaio 2012 alle 13:22 #92638ugougougoPartecipante
Apri il file page.php e fanne una copia di sicurezza.
Togli la riga che mostra il titolo nelle pagine, la stessa di cui abbiamo già parlato, in genere è racchiusa dentro un tag <h>.
A questo punto non avrai i titoli in nessuna pagina, ma nelle pagine in cui ti interessa averli puoi aggiungerli tu manualmente nel corpo del testo, se le pagine non sono tante.
grazie, provato e funziona perfettamente ma è effettivamente è poco pratica con numerose pagine da gestire e comunque poco elegante in generale.
Ho trovato però come risolvere la cosa, la riporto per chi fosse interessato:
la riga da individuare e che gestisce la visualizzazione del titolo pagina non era nel file page.php ma è in template-fullwidht.php nel mio caso, cioè lo stile di pagina associato da me, attraverso apposito pannello ATTRIBUTI PAGINA.(sulla DX in teoria, sotto il box deidcato alla PUBBLICAZIONE pagina) .
Aggiungo che: gli stili/template pagina e il loro codice che gestisce il titolo, possono cambiare a seconda del tema wordpress che si usa, comunque il codice suggerito da titty credo si possa intendere come quello di base a cui riferirsi per cercare simile nel proprio sito/template wordpress, fra i vari php che lo compongono o meglio fra i php che impostino il layout delle pagine, e come detto poco più sopra selezionabili nel pannello apposito…
ecco la santissima porzione di codice (non pubblicata prima perchè dovevo capire ancora il passaggio precedente…):
ho modificato la riga cosଠla riga:
.8 <h2 class="nice_title"><?php the_title(); ?> <span><?php echo stripslashes(get_post_meta($post->ID, "subline", true));?></span></h2>
ho tolto solo the_title();, mantenendo il resto invariato. In questo modo sparisce solo il titolo pagina e mantendo attivo e visibile gli elementi classificati come subline e che mi piace restino visibili.
Ora se salvo il mio file template-fullwidht.php, la modifica appena fatta, verrebbe applicata ovviamente a tutte le pagine che abbiano associato il template pagina “fullwidht”, cosଠcercando sul web ho trovato soluzione di “rifinitura”:
nella riga, ho aggiunto no title:
.2 /* Template Name: Fullwidth no title */
ho salvato il php con il nome template-fullwidth_notitle.php e caricato su server.
Tornando nelle impostazioni delle pagine ora ho a disposizione due varianti del template a tutta pagina: con e senza visualizzazione del nome pagina all’interno della pagina stessa. posso cosଠscegliere fra le due versioni di impaginazione usare a seconda delle necessità che ho per le varie pagine del sito. Ciao!
-
28 Gennaio 2012 alle 17:37 #92643TittiModeratore
effettivamente è poco pratica con numerose pagine da gestire e comunque poco elegante in generale
Se intendi poco elegante dal punto di vista della “programmazione” posso essere d’accordo, anche perché non si tratta di programmazione.
Per il resto non capisco perchè poco elegante dato che il titolo lo puoi inserire nel tag che preferisci… quello che dà lo stile a tutti i tuoi titoli (e quindi sarà uguale agli altri titoli, <h2 class=”nice_title”> mi sembra di capire) o in una classe fatta apposta come ti pare.
Poco pratica… bè certo dipende dal numero di pagine. Se ne hai dieci farai copia incolla del titolo dieci volte, ma fatto una volta rimane lଠnon devi gestire niente, è normale testo che togli metti lasci quanto vuoi.
Comunque anche fare copia del template e togliere la stampa del titolo è un’ottima e semplice soluzione.
Là però puoi dare un sottotitolo o un titolo che vuoi, non necessariamente lo stesso della pagina.
-
29 Maggio 2012 alle 19:55 #95916glpressPartecipante
io ho lo stesso problema coi titoli dei menu e dei vari widget ,che parte dovrei eliminare visto che alcuni vorrei comparissero?
-
29 Maggio 2012 alle 20:11 #95918TittiModeratore
Leggi usare forum di supporto, e poi apri un topic tuo con il tuo problema, come da regolamento. Non ha senso accodarsi ad un altro topic.
-
29 Maggio 2012 alle 20:20 #95920glpressPartecipante
un topic inerente l’ho scritto oggi ma non lo trovo più
-
17 Settembre 2012 alle 12:25 #97549WoodyPartecipante
Ragazzi a 7 mesi dalla soluzione di “kiinastudio”
c’è stato qualche aggiornamento di WP che permette di fare la cosa direttamente dal pannello della pagina, articolo ecc.?
sembra una funzione quasi indispensabile, quasi ovvia a pensarci.
Disattivare o attivare il titolo, semplicemente con una spunta, in joomla e penso anche drupal c’e sempre stato.
grazie
-
17 Settembre 2012 alle 14:31 #97551wollyAmministratore del forum
Usa joomla o drupal se quella funzionalità per te è fondamentale.
In alternativa ti crei un tuo tema con il suo pannello di controllo e gli metti la checkbox.
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.