WordPress.org

Forums

Change posts category from code (on "publish post") (2 posts)

  1. vekica
    Member
    Posted 4 years ago #

    Hi guys.
    On my WP magazine I am using
    1. HEADLINE category (only 1 posts is showing on my home page)
    2. FEATURED category (4 posts are showing on home page)
    3. 10 others categories for topics that my site is dealing with (training, equipment, health, injuries....)

    My process
    I am always SCHEDULING posts to show on HEADLINE + ONE MORE CATEGORY (TOPIC). I must come after and manually edit my old post and exclude HEADLINE category (because this posts are only showed on headline section of my magazine)

    Problem: What i want?
    When the post is published (when schedule time happens) I want WP goes through all my published posts (better to take last published posts for speed optimization) and to exclude that posts from HEADLINE CATEGORY.

    Is this possible to do in functions.php?

  2. vekica
    Member
    Posted 4 years ago #

    Ok, now when I read this even I dont understand what I wanted to ask :))

    So, can you help me with this:

    When the new post is published I want to automatically change category for other published posts.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.