Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Forum: Plugins
    In reply to: [WP Catalogue] Product urls

    One more thing: I am installing the plugin on a Multi-Site install, but only activating it on the site I need it for.

    Just to make sure, it’s not that, I installed it on my personal blog. Changed the slug, activated plugin, added dummy product, and got 404 error trying to view individual page.

    Deactivated but left installed, changed the slug back to ‘wpcproduct’, re-activated, and the individual page worked again.

    (Rebuilt permalinks at every step, just to be safe.)

    Forum: Plugins
    In reply to: [WP Catalogue] Product urls

    @maeve,

    In trying to track this down, I found the following in the debug.log:

    [09-Apr-2013 16:22:50 UTC] PHP Notice:  Undefined index: post_type in /home/example/public_html/wp-content/plugins/wp-catalogue/index.php on line 106

    I switched the slug back to ‘wpcproduct’, but I was still gettting a 404 error on individual products, although I could see them in the admin list because they were being pulled by post number.

    I tried refreshing the permalinks, but no luck. I ended up deactivating and deleting the plugin, and then reinstalling it. After one more permalink rebuild, the products came back, but now I’m back to square 1.

    Forum: Plugins
    In reply to: [WP Catalogue] Product urls

    @ilovebunny,

    I reset the permalinks, and even deactivated/reactivated the plugin. Still not working.

    Forum: Plugins
    In reply to: [WP Catalogue] Product urls

    @maeve,

    Thanks for the sanity check.

    I may have found another workaround that you may be able to incorporate into your next version. I was reading up on custom post types for another little project and came across this:

    http://codex.wordpress.org/Post_Types#URLs_of_Namespaced_Custom_Post_Types_Identifiers

    It looks like you are already using the the suggested pretty-URL method, so wouldn’t it just require changing:

    'rewrite' => array("slug" => "wpcproduct"), // Permalinks format

    to:

    'rewrite' => array("slug" => "products"), // Permalinks format

    and leaving all the internal IDs as “wpcproduct” for namespacing?

    However, I tried this on our development site, and the shortcode is generating links to individual products in that format, but when I click on them, I get a 404 page.

    I thought that maybe there was some hardcoding somewhere, but a cursory look didn’t find it. Also, if I manually change the URL back to the old slug of “/wpcproduct/…”, it gets re-written to “/products/…” and then still 404’s out!

    Any idea where this obstacle may be in the code?

    Forum: Plugins
    In reply to: [WP Catalogue] Product urls
    van-knowmad

    (@van-knowmad)

    If we are just starting out using this plugin, would it be possible to change the CTP name in the file products/wpc-product.php from its original value “wpcproducts” here:

    function wpt_wpcproduct_posttype() {
        register_post_type( 'wpcproducts',
                     array(...

    to just “products”, like this:

    register_post_type( 'products',

    so that the URLs have “…/products/<name>” instead of “wpcproducts…” ?

    I know we would need to make this change after every upgrade, but is it just this easy if we are starting out?

    @ipstenu,

    Thanks for the article.

    We have a client that is current running 14 blogs with Movable Type, and we’re considering moving them to WP.

    For 13 of the blogs, I’m sure we do NOT want multisite, because each author’s posts live /blogs/frodo, or /blogs/samwise, but the index page at /blogs lists the most recent post from each author. (They also have a static homepage, with links to a non-MT forum, a wiki, and custom pages, but we pull excerpts fromt the latest posts into that with a custom PHP function with SQL query.)

    Would you recommend migrating their whole site to WP, with custom index page, /blogs index page, and /blogs/frodo et al. pages as author archives? If we do that, can we also have monthly archives for each blog like this: /blogs/frodo/2012/01 ?

    The 14th blog may warrant multisite. It is a long series of 40-some tutorials in its own “subfolder”, /tutorials. We have them linking forward and back by “date” just by juggling the publishing dates. Some of the authors of the character blogs also write the school articles anonymously, so we would add them as users of both sides of the multi-site install, if we go that way.

    But, could we do the /tutorials along with the others, because the theme would be the same, but the content area of the templates is very different?

    (I think I just remembered you saying that multisite limited the iframe and JS of content authors, so I think we would have to make it work all under one blog, because they often add “widgets” and videos to improve the lessons.)

    Thread Starter van-knowmad

    (@van-knowmad)

    It turns out that someone had used a script to add a bunch of redirects to the .htaccess file, including ones that redirected:

    /page/2?
    /page/3?
    /page/4?

    to the homepage.

    Once I got rid of those, pagination worked without even adding any custom WP rewrite rules.

    Thread Starter van-knowmad

    (@van-knowmad)

    Need to add: After additional testing (I changed the template to only show 1 post per page), page numbers that start with 2, 3, or 4, like:

    /latest/page/20
    /latest/page/30
    /latest/page/40
    /latest/page/200
    /latest/page/300
    /latest/page/400

    don’t work either, but /latest/page/50 works !

    Curiouser and curiouser…

    Thread Starter van-knowmad

    (@van-knowmad)

    Need to add: After additional testing, (changed to showing page numbers that start with (

    van-knowmad

    (@van-knowmad)

    Inside your while (have_posts()) : loop, you should be able to use the_title() and the_content to print the title and content, or prefix those two functions with get_ if you need to assign them to a variable.

    (You should be able to use the existing get_header function for a custom page template, to write the HTML <head> element with the page’s title, but that depends on your theme.)

    Hope some of this helps.

    Thread Starter van-knowmad

    (@van-knowmad)

    P.S. I forgot to mention this article, which got me started on the right track, and helped me figured this out:

    Passing Query String Parameters in WordPress URL

    Thread Starter van-knowmad

    (@van-knowmad)

    @ifdion, Thanks for your suggestions.

    I saw something similar that worked in this thread: http://wordpress.org/support/topic/archive-list-and-page-for-custom-post-types-mysql?replies=2, but I was trying not to create even more custom pages than I already had.

    I finally found a way to use WordPress-style archive templates by adding these lines to our theme’s functions.php file:

    // Add custom rewrite rules to handle things like years in custom post archives
    function add_rewrite_rules($aRules) {
        $aNewRules = array(
            'news/([0-9]{4})/page/?([0-9]{1,})/?$' => 'index.php?post_type=news&year=$matches[1]&paged=$matches[2]',
            'news/([0-9]{4})/?$' => 'index.php?post_type=news&year=$matches[1]',
            'event/([0-9]{4})/page/?([0-9]{1,})/?$' => 'index.php?post_type=event&year=$matches[1]&paged=$matches[2]',
            'event/([0-9]{4})/?$' => 'index.php?post_type=event&year=$matches[1]'
        );
        $aRules = $aNewRules + $aRules;
        return $aRules;
    }
    
    // hook add_rewrite_rules function into rewrite_rules_array
    add_filter('rewrite_rules_array', 'add_rewrite_rules');

    With these new rules, if I use URLs like /news/2011, WordPress will use my custom template archive-news.php, which I based on archive.php, to show a yearly archive of news articles.

    This article were a great help in figuring this out:

    http://www.dev4press.com/2012/tutorials/wordpress/practical/debug-wordpress-rewrite-rules-matching/

    Thread Starter van-knowmad

    (@van-knowmad)

    @kingstringy: I think I tried that plugin, but I couldn’t get the links to come out right.

    I agree that it is so basic, there should be a How-To for it in the Codex.

    @ifdion: If I use your method, what would the page and file structure look like? Right now we are grouping Blog Posts, News, and Events under one custom page called “The Latest” with a custom template. Each one of those has a custom sub-page that lists the most recent from that type of post with links to archives (they share a custom template).

    latest/blog
    latest/news
    latest/events

    Would I then need sub-pages like, “latest/news-archive” or would it be “latest/news/archive/?year=2011” ?

    Ideally, I’d like them archives to look consistent, something like “/latest/news/2011/” or “latest/news/archive/2011

    Thread Starter van-knowmad

    (@van-knowmad)

    Thanks for the info. I do think this is one of the better sitemap plugins out there.

Viewing 14 replies - 1 through 14 (of 14 total)