Developing child theme : want generate a TOC of archives (and specialized)
-
Hi,
circumstancies
I would get a table of content for the specialized templates using the loop.In one way, the archive template structure is an automate to build particular posts which gives list of post or excerpts etc.
In my case one templates displays an enhanced list of articles, with all meta data, number of word, printed pages when document is printed etc. and an excerpt.
The problem is :
– How to do so that the content generated becomes like the current
$post->content
. In fact create a temporarily post which will be known by plugins as the table of content.Best regards
Trebly
_______________________________________________________________________Complements
Then a plugin like TOC+ which widget calls the content by
$post = get_post( $wp_query->post->ID );
will get the right content.Note: the development makes the titles of post to be h1 tags etc…
Content for an article :
– title link
– We find an excerpt (when it is not automatic limited to 500c. by parameter, it can be a text of variable length)
– read more,
– meta data : author, dates, length; hits etc..
– tags,
– categories etc…This can use quite half or more of a viewport.
Then, when there are twenty or more articles reported, a table of content with only the titles of articles is something very useful.
Note ;: for an unknown reason for now with categories (category.php) the toc gets the last post full TOC, in other cases it is empty
- The topic ‘Developing child theme : want generate a TOC of archives (and specialized)’ is closed to new replies.