• Does anyone know if it is possible to have the page title show up in the widget menu title instead of just a generic word (i.e. I don’t want it to say “Menu” but instead the title of the page). I’m sure I could probably do this by hacking the plugin file, but I prefer not to do this because updating will be a pain.

    Thanks!

    http://wordpress.org/extend/plugins/anchors-menu/

Viewing 1 replies (of 1 total)
  • Thread Starter phycel

    (@phycel)

    Just in case anyone else wanted to do this, here is what I did…

    First, I don’t like editing the code of a plugin due to automatic upgrades – sometimes I forget whether I’ve hacked a plugin or not. So, I copied all of the plugin code to my functions.php file and deactivated the actual plugin. But before doing so, I added these three lines just before line 140:

    echo "<h3>";
    		if (is_page()) { the_title(); }
    		else if (is_category()) { single_cat_title(); }
    		else if (is_tag()) { single_tag_title(); }
    		else { echo "Menu"; }
    		echo "</h3>";

    Then, instead of bothering with the widgets, I just added this line of code to my sidebar.php file where I wanted it:

    anc_insert();

    Of course, this works well for my theme and situation. Thanks to the plugin author for providing some very useful code! In the next release, the developer might want to consider putting a chekbox in the widget settings allowing us to choose to use the page/post/category title, etc. 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Anchors Menu] Using page title in widget menu title’ is closed to new replies.