WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: List category posts] List Category Posts > TwentyTen (WP 3.0) compatible template (11 posts)

  1. DougJoseph
    Member
    Posted 4 years ago #

    Thanks for a great plugin! I am using it with WP 3.0's new default theme, "Twenty Ten"...

    I have created a new template for the plugin to use in displaying the category posts on Twenty Ten's pages. I'm trying to tweak the template to make it compatible with the "Twenty Ten" theme. If I can succeed I would love for the new template to be a blessing to others for their use.

    So far, I have only two main issues I need help with:

    1. AESTHETICS - Shortcode for Caption not handled:
    In the "List Category Posts" plugin's output, the "Caption" Shortcode (a core part of WP) is not being parsed or handled. To see an example of this in action, visit this page. That page shows static page content at the top, and the posts under it (starting with the HR tag) are related category posts. How can I get the "List Category Posts" plugin to parse or handle the the "Caption" Shortcode?

    2. SECURITY: Admin's real username shown
    We are using a technique (for added security) of having an admin username other than "admin." The idea is to keep that name hidden. It provides one more layer of obfuscation (requires one more step for hackers). However, the plugin currently shows it. The "show author" portion of the code provides the author's "nicename" instead of the "display name" or the "nickname." How can I edit the template code (shown below) to show the "display name"? (The "nickname" would be acceptable too, either/or.) Also is there a way to preserve the case of the name (e.g. "DJones" instead of "djones")?

    //Show author?
    	if($atts['author']=='yes'){
    		$lcp_userdata = get_userdata($single->post_author);
    		$output.= ' - ' . $lcp_userdata->user_nicename;
    	}

    Thanks again for such a great plugin! I am in high hopes that I can create a TwentyTen (WP 3.0) compatible template for the plugin (one that does not require messing with core files and is totally upgradable), and make it available to all.

    http://wordpress.org/extend/plugins/list-category-posts/

  2. DougJoseph
    Member
    Posted 4 years ago #

    Ok, we have found the answer for #1 above. Found an answer on this page: http://wordpress.org/support/topic/320014?replies=6
    ...That led to this page: http://wordpress.org/support/topic/320635?replies=2
    ...Which led to this page in the Codex: http://codex.wordpress.org/Template_Tags/the_content#Alternative_Usage

    ...Which shows the following code for applying filters to get the shortcodes parsed:

    <?php
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    ?>

    Below is how we used that info to solve the problem of how to get the shortcodes parsed. By simply experimenting, I got this to work by changing this:

    //Show content?
    	if($atts['content']=='yes' && $single->post_content){
    		$output.= '<p>' . $single->post_content . '</p>';
    	}

    ...to this:

    //Show content?
    	$output.='<div class="entry-content">';
    	if($atts['content']=='yes' && $single->post_content){
    		$content = apply_filters('the_content', $single->post_content); // added to parse shortcodes
    		$content = str_replace(']]>', ']]&gt', $content); // added to parse shortcodes
    		$output.= '<p>' . $content . '</p>'; // line tweaked to output filtered content
    	}
  3. DougJoseph
    Member
    Posted 4 years ago #

    Now, if someone can help me get the author's display name (or nickname) to show instead of "nicename" currently shown in the plugin's template....

    We'll have a fairly solid WP 3.0 'Twenty Ten' compatible version of the plugin. Anyone have any tips?

  4. picandocodigo
    Member
    Posted 4 years ago #

    Hey DougJoseph, thanks for such a great job. #2 was fixed on version 0.9 which I just uploaded.

    Version 0.10 will include the fix you found for the_content. Thanks!!

  5. DougJoseph
    Member
    Posted 4 years ago #

    Excellent! Thanks!

    Perhaps you can say the plugin is now compatible with WordPress 3 / Twenty Ten...

  6. picandocodigo
    Member
    Posted 4 years ago #

    Have you tested it with WordPress 3 / Twenty Ten? If so, please let me know if it works, so that I can say it's compatible :)

    Thanks! Regards

  7. DougJoseph
    Member
    Posted 4 years ago #

    Yes, I have tested at this page:

    http://baseline.wvupci.org/?page_id=16

    It displays the full content 'filtered' and it displays the author's 'display name' instead of actual username. Great! Thanks!

    Please take a look at the page to see if the formatting is as you would like it to be. When you are satisfied with the test, I may later remove the page.

  8. DougJoseph
    Member
    Posted 4 years ago #

    PS: That test was done on a "baseline" WP 3.0 (latest build as of this time) with the default Twenty Ten theme running.

  9. DougJoseph
    Member
    Posted 4 years ago #

    Fernandot:

    Hello friend. :-)

    I have found another issue with regard to the "List Category Posts" plugin's compatibility with WP 3.0 / Twenty Ten.

    If the page (which is displaying category posts) has any photos attached to it, and any one of the displayed category posts has a gallery of photos set to display, then the page's photos get displayed instead of the category post's photos.

    While I understand the problem, I confess I don't know how to fix it.

  10. buckyreal
    Member
    Posted 3 years ago #

    The widget doesn't hold the chosen category. After selecting a category the dropdown snaps back to the first item in the list.

  11. DougJoseph
    Member
    Posted 3 years ago #

    You might try to post your widget issue on the plugin page, or try contacting the author of the plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic