Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter Maxell_WP

    (@maxell_wp)

    So basically no one knows how to achieve this.. this is one of the reasons I just delete WP after wasting so much time..

    Thread Starter Maxell_WP

    (@maxell_wp)

    Thanks Sara, but its a simple query, I would not prefer using any plugin for this. I also tried to group result with direct query, below is my query:

    $wpdb->get_results("SELECT * FROM wp_posts WHERE post_type='episode' GROUP BY post_parent ORDER BY post_modified DESC LIMIT 32;");

    it doesn’t sort with post_modified DESC, but if I remove GROUP BY post_parent, it perfectly displays all recently updated posts. Is there any way to handle this ? Following query works if I remove GROUP BY…

    $wpdb->get_results("SELECT * FROM wp_posts WHERE post_type='episode' ORDER BY post_modified DESC LIMIT 32;");

    The only workaround I did was running query on 1000 posts and then adding post_parent to one array and for final out code checking with if parent is in excluded IDs, then not add in final output.. something like below:

    if (!in_array($ep_parent_media_id, $excluded_cats)) {

    but to get only 32 posts I have to query 500 posts if there are more than 200 updated posts under one drama. This is wrong.. There must be a very simple way, but due to my limited knowledge on WP I cant get it work, any experienced developer can write max 10 lines of code and fix it.. Lets hope someone replies….

    thanks for your suggestions though ??

    • This reply was modified 3 years, 8 months ago by Maxell_WP.
    • This reply was modified 3 years, 8 months ago by Maxell_WP.

    I got it, thanks Edward. Just for my understanding before I look at the database tables and code, does it make multiple posts or retains the same single posts, because otherwise if I have 1 million posts and 10 websites, so you can see how many posts will be duplicated… Thanks for further clarification, I will contact through your website.

    Hi Edward, I must say if this works correctly its an amazing plugin, I would definitely go the the Ultra pack after testing it on my sites.. However, I have the same issue OP posted, I installed it on Network, but when I goto create post I dont see the “Sites” to select, then I tried to turn on the Debug mode, now when creating post I can see the the Debug info which is below:

    ————–

    Debug info

    High enough role to link: yes
    Post supports custom fields: yes
    Post supports thumbnails: yes
    High enough role to broadcast custom fields: yes
    High enough role to broadcast taxonomies: yes
    Blogs available to user: 1

    Plugins that have hooked into save_post:
    delete_get_calendar_cache
    threewp_broadcast\ThreeWP_Broadcast::nop
    threewp_broadcast\ThreeWP_Broadcast::save_pos`

    I cannot see the option to select sites in network, remember I tried this on latest version of WordPress I just downloaded 2 hours ago. May be its the compatibility issue ?..

    Secondly, do we only have to install it on Network on all network sites ? Currently I cannot see the option to Broadcast. Any hel would save some time.. thanks
    ————————-

    Thread Starter Maxell_WP

    (@maxell_wp)

    Hi @lopo,

    Thanks for your reply. The problem is I have more than 2000+ posts, I cannot find all required posts on 1 page to select and bulk clone, with your suggestion it get more worst as I have to search each post then click CLONE and then delete original.

    With Bulk Clone and Delete option (where we post e.g. 50 posts or more), it would be helpful to get rid of old posts and keep new with new url (slug) and save time for cloning individual posts and then deleting them.

    PS: on a side note, if I want to customize the code which automatically deletes original post and instead of Draft it should actually create clone. Which files/code should I modify.

    thanks again for your help.
    regards

    Thread Starter Maxell_WP

    (@maxell_wp)

    Thanks Capuderd,l looking forward.

    regards

    Thread Starter Maxell_WP

    (@maxell_wp)

    Thanks ?? worked like a charm.. you are a life savor.. It helped me achieve what I envisioned. I need a donate button just for Thanks for this plugin, I hope I dont offend you ??

    regards

    Thread Starter Maxell_WP

    (@maxell_wp)

    Hi Capuderg, you are right ?? I solved those issues, and also rated your amazing work..

    Just one last thing, that I will looking forward is the size of images. My theme has custom image sizes, but while importing it adds a lot more.. so if I follow and add your filter

    add_filter( ‘pt-ocdi/regenerate_thumbnails_in_content_import’, ‘__return_false’ );

    it only imports MAIN large image.. how can I specify which formats should be imported, or where exactly that code is placed so I an modify it accordingly..

    regards

    Thread Starter Maxell_WP

    (@maxell_wp)

    Setting front page ??

    // Set Front Page from Reading Options
    $front_page = get_page_by_title( ‘Home’ );
    if(isset( $front_page ) && $front_page->ID) {
    update_option(‘show_on_front’, ‘page’);
    update_option(‘page_on_front’, $front_page->ID);
    }

    moving forward, sorry for spamming my own thread.. might be helpful for other..

    regards

    Thread Starter Maxell_WP

    (@maxell_wp)

    ok ?? before import also solved the widgets issues.. just check with demo import name and register sidebar before widget import.. Great.. loving it.. let me handle next..

    regards

    Thread Starter Maxell_WP

    (@maxell_wp)

    Ok, I have solved the issues of Sidebar registration, it has to be an array…

    $sidebars = array(
    ‘ContactUs’ => ‘Contact Us’,
    );
    update_option( ‘sbg_sidebars’, $sidebars );

    for the rest still testing ??

    thanks

    Thread Starter Maxell_WP

    (@maxell_wp)

    function add_class_to_wp_nav_menu($classes, $item)
    {
        switch (get_post_type($item->ID))
        {
            case 'portfolio':
                $classes = array_filter($classes, "remove_parent_classes");
    
                if (123 == $item->ID)
                {
                    $classes[] = 'current_page_parent';
                }
                break;
        }
        return $classes;
    }
    add_filter('nav_menu_css_class', 'add_class_to_wp_nav_menu', 10, 2);

    thanks to d79.. stackoverflow…

    Thread Starter Maxell_WP

    (@maxell_wp)

    Thanks to Nathan on Stackoverflow, my 404 page was empty ?? so this has been resolved..

    regards

    Thread Starter Maxell_WP

    (@maxell_wp)

    *sorry the ID I was referring is page_id=2 not 12..

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