Perché the_content () non mostra il contenuto?
-
-
Qual èil codice che lo circonda?Seinelgiro?What is the code that surrounds that? Are you in the loop?
- 2
- 2012-03-02
- mor7ifer
-
Qualetema stai usando?Se sitratta di untemapersonalizzato,sarànecessario visualizzareil * codicepersonalizzato *perilfilemodelloin questione.What Theme are you using? If it is a custom Theme, then we will need to see the *custom code* for the template file in question.
- 0
- 2012-03-02
- Chip Bennett
-
Ho uno di queiproblemi.Credo che si verifichi a causa di un altro WP_Queryfattoprima dithe_content ().I got on one of those problem. I believe it occurs due to a another WP_Query made before the_content().
- 0
- 2012-03-02
- ifdion
-
Mi è successo durante l'aggiornamento a WP5Happened to me when upgrading to WP5
- 0
- 2019-06-28
- Fanky
-
Non soperché questo sia contrassegnato comeimprobabileper aiutarei futuri visitatori: è unabuona domandae ha risposte utili.Questonon sembrapiù "straordinariamente stretto" di qualsiasi altra domanda su WordPress Stack Exchange.I don't why this is marked as unlikely to help future visitors - it's a good question and has useful answers. This doesn't seem any more "extraordinarily narrow" than any other question on WordPress Stack Exchange.
- 0
- 2020-07-31
- JohnG
-
3 risposta
- voti
-
- 2012-03-02
Perpoter utilizzare "the_content ()" deveessere utilizzato all'interno di The Loop.
Vedi qui: http://codex.wordpress.org/Function_Reference/the_content
"Visualizzai contenuti delpost corrente. Questotag deveessere all'interno di The_Loop."
In order to use "the_content()" it must be used within The Loop.
See here: http://codex.wordpress.org/Function_Reference/the_content
"Displays the contents of the current post. This tag must be within The_Loop."
-
è un single.phpe hafunzionatoprimaits a single.php and it worked before
- 0
- 2012-03-02
- srisar
-
ma allora comefunziona $post->post_content?inoltrefunziona anchethe_title () ..but then how $post->post_content works? plus, the_title() also works..
- 4
- 2012-03-02
- srisar
-
Anche single.php deve avere The Loop su diessoper recuperareil contenutoe i valori deimetacampipersonalizzati.Per quanto riguardathe_title () [senon sbaglio] è un campo sempre definito.Nonpuoi avere unpostpubblicato senza averinserito untitolo.Peresseretecnicamentee WP corretto,anchethe_title () dovrebbeessere all'interno di The Loop. Se sei contrario all'uso di The Loope $post->post_content,puoi sempre usare lafunzione apply_filters ()per visualizzareil contenuto.http://codex.wordpress.org/Function_Reference/the_content#Alternative_UsageEven single.php needs to have The Loop on it to retrieve the content and custom meta field values. As for the_title() [if I'm not mistaken] is an always defined field. You can't have a published post without a title being input. To be technically and WP correct, the_title() should be within The Loop as well. If you're against using The Loop and $post->post_content works, you could always use the apply_filters() function to display the content. http://codex.wordpress.org/Function_Reference/the_content#Alternative_Usage
- 0
- 2012-03-02
- The Z Man
-
grazie,per latua risposta,mi chiedevo soloperché ha smesso difunzionare,hafunzionatoprima.comunquegrazie,se hotrovato lamia colpa sicuramenteposterò qui cosìpotrebbe aiutare qualcuno.thanks, for your reply, I just wondered why it stopped working, it did worked before. anyway thanks, if I found my fault I will surely post here so it might help someone.
- 0
- 2012-03-02
- srisar
-
Noproblemo srisar!Buonafortunaperilfuturo.Setrovi una soluzione o una rispostamigliore,sì,perfavorepubblicala qui :)No problemo srisar! Best of luck going forward. If you find a better solution or answer, yes, please post it back here :)
- 0
- 2012-03-02
- The Z Man
-
peccato chenonfacciapiùparte dellapagina del documento ...too bad that's no longer part of the doc page ...
- 0
- 2018-11-12
- Benjamin
-
- 2012-03-02
Seprimafunzionava,probabilmente è unplugin che si aggancia alfiltro_content.Disabilitai plugin unoper unoper vedere se questo risolveilproblema.Quindi,controlla lefunzioni di callbackperilfiltro
the_content
.Puoi vedere ogni callbackperthe_content aggiungendo quanto segue:
add_action('template_redirect', 'wpse_44152_template_redirect'); function wpse_44152_template_redirect(){ global $wp_filter; print_r($wp_filter['the_content']); }
Trova ciascuna dellefunzionielencateeseguendo una ricerca del codice "trovanei file"neltuoeditor di codice.Un callback delfiltro DEVE restituirei dati di $ content affinchéthe_content ()funzioni correttamente.
If it worked before, it's probably a plugin hooking into the_content filter. Disable your plugins one by one to see if this fixes the issue. Next, check the callback functions for
the_content
filter.You can see every callback for the_content by adding the following:
add_action('template_redirect', 'wpse_44152_template_redirect'); function wpse_44152_template_redirect(){ global $wp_filter; print_r($wp_filter['the_content']); }
Find each of the functions listed by doing a 'find in files' code search on your code editor. A filter callback HAS TO return $content data back for the_content() to work properly.
-
- 2012-11-26
puoi controllareiltuofunctions.phpnella cartella deltema,scoprire se qualchefunzionefa qualcosaper lafunzione "the_content". Ilmiotema ha lo stessoproblema,e ho scoperto che unafunzione ha unerroree perché "the_content"può 't lavoro
trovatesto come "the_content"neltuofunctions.php,
you can check your functions.php in your theme folder,find if some function do something for the "the_content" function.my theme have the same problem,and I found a function has a mistake and cause "the_content" can't work
find text like "the_content" in your functions.php,
nelmio sito wordpress,the_content ()nonmostrail contenuto,ma $post->post_content lomostra,perché sta succedendo?e comeposso utilizzare dinuovothe_content?