• Resolved JimByrneScotland

    (@jimbyrnescotland)


    Hi, I’m using the widget to add a simple list of posts in a category and then styling the current link so it is highlighted. The list is embedded within a page where none of the links in the post link are the current page – so there should be no current class added. But the final post in the list is always getting the class added to it – no matter how many posts there are. I’m using the same idea on several pages – and they all have the final post highlighted, i.e. the class=current is being added to the final <li> element. This means I’m getting a link highlighted – even thought it’s not the current page.

    I’m using the default template. Can anyone help?

    WordPress 6.3.1 List Category posts version 0.89

    Thanks,

    Jim

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor zymeth25

    (@zymeth25)

    Hi, I’ve written a fix for this, please install the development version of the plugin (link below) and confirm the problem is solved on your side. If all is good we will publish the fix in the next release.

    https://github.com/picandocodigo/List-Category-Posts/archive/refs/heads/master.zip

    Thread Starter JimByrneScotland

    (@jimbyrnescotland)

    Hi zymeth25,

    Thanks. I’ve just tried to install the plugin by uploading it and activating it on the website, but I got the following  error:

    Plugin could not be activated because it triggered a fatal error.

    Fatal error: Cannot redeclare lpc_meta() (previously declared in /home/dh_v2vxpj/lightaware.jimbyrne.co.uk/wp-content/plugins/list-category-posts/list-category-posts.php:203) in /home/dh_v2vxpj/lightaware.jimbyrne.co.uk/wp-content/plugins/List-Category-Posts-master/list-category-posts.php on line 203

    Was I supposed to install it in a different way? Your help is much appreciated. 

    Jim

    Plugin Contributor zymeth25

    (@zymeth25)

    Yes, this is because the dev version from github has a different directory name than the regular plugin. The easiest fix is to change the folder name inside the zip from List-Category-Posts-master to list-category-posts.

    Or you could just deactivate and remove LCP and install the zip as is.

    Plugin Contributor zymeth25

    (@zymeth25)

    Fix is included in v0.89.1

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘current class is being added to final post in list’ is closed to new replies.