Recent Topics

Suggest add the 'table of a post content' feature

started by on Feb 24, 2017 – Last touched: Mar 03, 2017

Feb 24, 2017 14:37    

I published an article some days ago, the link is : , witch feature is adding a table of the content by html tag h1 to h6 automatically.
These days I found an easy way to do it, just link a js file and add a line code would be OK.(We can achieve by a plugin or widget)
More info , please see the second floor.

Mar 02, 2017 08:39

When I make this plugin by using default TEST plugin, everything running OK, but the anchor of the table title which should jump into the content title, is not link to the current content page. So the question is that how can I get current content page url?

Mar 02, 2017 19:03

@haharen the current post is available through the global variable $Item.

Let's say you are coding a widget, so its display method should be something like this:

function display( $params )
	global $Item;

	echo '<a href="'.$Item->get_permanent_url().'#foo">Foo</a>';

This post has 1 feedback awaiting moderation...

Form is loading...

powered by b2evolution free blog software – This forum is powered by b2evolution CMS, a complete engine for your website.