• I am trying to display 1 category in a particular spot on a page and using the shortcode [link-library categorylistoverride=”2″] I get NO RESULTS FOUND. I have checked several times and the category ID is definitely 2. Please help. I have looked everywhere in settings. PLEASE help.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Yannick Lefebvre

    (@jackdewey)

    Sorry for late response. Is the page where you are trying to display this online where I could see it? Can you turn on debug mode for the plugin?

    I am having the same issue.

    It worked fine up until recently.

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    I just tested this feature in my development environment and cannot reproduce the issue. Are you sure that you have the correct category ID for the links to be displayed.

    One way to check what is happening is to enable Debug mode for Link Library under the plugin general options. If you refresh the page with the link library shortcode, and look at the page source, you can search for ‘Link Query’ and you will find a comment with the SQL query that is being generated to retrieve links.

    To see if the query is valid, copy and paste it into your site’s database administration tool (often phpMyAdmin) and see if any error messages are generated. Let me know what the results of your investigation are and please consider donating to support this plugin’s development.

    Hi Yannick, thanks for your response.

    I think it may be because I have changed the prefix of my database tables from wp_ to something else.

    In which case, where can I go to amend the code in the plugin?

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    Changing the prefix of tables does not require changing the plugin code, as the plugin queries the wordpress installation to ask for the query. That being said, if you did change the prefix and you are still just seeing wp_ in the query, it might indicate that something was not set right when you changed the table prefix.

    If you look inside of link-library.php on lines 382 to 389, you will see the function I call to get the database prefix. You could try adding some debug statements in that code to see what gets returned by get_blog_prefix.

    I assume you have set the $table_prefix variable inside of your site’s wp-config.php to the new prefix? This might sound like a silly question, but perhaps you have found a clever way of changing the table prefix without changing this variable.

    Looking at a tutorial like https://www.wpbeginner.com/wp-tutorials/how-to-change-the-wordpress-database-prefix-to-improve-security/ on changing table prefix, it also mentions going through options and user meta for items that have wp_ in their name. Did you do that as well?

    It doesn’t seem to be the prefix.

    Here is the code from the debug (462 is the category I am wanting to display)

    <!-- Link Query: SELECT distinct *, l.link_id as proper_link_id, UNIX_TIMESTAMP(l.link_updated) as link_date, IF (DATE_ADD(l.link_updated, INTERVAL 7 DAY) >= NOW(), 1,0) as recently_updated FROM jdg78_terms t LEFT JOIN jdg78_term_taxonomy tt ON (t.term_id = tt.term_id) LEFT JOIN jdg78_term_relationships tr ON (tt.term_taxonomy_id = tr.term_taxonomy_id) LEFT JOIN jdg78_links l ON (tr.object_id = l.link_id) LEFT JOIN jdg78_links_extrainfo le ON (l.link_id = le.link_id) WHERE tt.taxonomy = "link_category" AND l.link_id is not NULL AND l.link_description not like "%LinkLibrary:AwaitingModeration:RemoveTextToApprove%" AND t.term_id in (462) AND l.link_visible != "N" ORDER by name ASC, link_featured DESC, l.link_id DESC-->

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    The query is valid, so something must not be found. When you renamed tables, did you rename all tables, or only the core WordPress tables? Link Library creates a custom table that has the name <prefix>links_extrainfo. So, in your case, you should have a table called jdg78_links_extrainfo. Please check if you have that table.

    Also, did you try running the query in phpMyAdmin to see what errors in might throw?

    I don’t seem to have the table links_extrainfo at all. How do I replace this?

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    You must have had one before. Otherwise, the plugin would never have worked correctly. You might want to look for backups of your site before you renamed tables to check.

    To re-create the table, you can just try deactivating and reactivating the plugin. If that does not work, use this SQL query in your site phpMyAdmin:

    CREATE TABLE jdg78_links_extrainfo (
    				link_id bigint(20) NOT NULL DEFAULT '0',
    				link_second_url varchar(255) CHARACTER SET utf8 DEFAULT NULL,
    				link_telephone varchar(128) CHARACTER SET utf8 DEFAULT NULL,
    				link_email varchar(128) CHARACTER SET utf8 DEFAULT NULL,
    				link_visits bigint(20) DEFAULT '0',
    				link_reciprocal varchar(255) DEFAULT NULL,
    				link_submitter varchar(255) DEFAULT NULL,
    				link_submitter_name VARCHAR(128) CHARACTER SET utf8 NULL,
    				link_submitter_email VARCHAR(128) NULL,
    				link_textfield TEXT CHARACTER SET utf8 NULL,
    				link_no_follow VARCHAR(1) NULL,
    				link_featured VARCHAR(1) NULL,
    				link_manual_updated VARCHAR(1) NULL,
    				PRIMARY KEY  (link_id)
    				)

    Please consider donating to support this plugin’s development.

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    Is the plugin working correctly now?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘category list override shortcode not working’ is closed to new replies.