• Hi everyone,
    You’ll laugh on my issue.
    Actually I want to add a plugin, which automatically fetch new content/news from various sources, RSS feeds etc.
    I want a structure, where these imported content don’t show on home page. Instead of that, I want to show them in a sub-section or in a different page like- NEWS, BLOG etc.
    Please guide, how do I create that type of structure without installing wordpress in different directory.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Hi smsjaipur – that need is not as uncommon as you might think. I’m a little surprised no one has offered any advice yet. Maybe it’s the time of year. My solution does require some custom coding. Even if you are not a coder, but at least have coder-like aptitude, you may be able to figure it out from similar examples.

    The posts that WP chooses to display is all accomplished through the WP_Query class. Within that class is an action called “pre_get_posts” which we can use to alter how WP_Query decides which posts to display. We can set or unset all sorts of query criteria, like date range, author, categories, custom fields, etc. A description of the various criteria:
    https://developer.www.ads-software.com/reference/classes/wp_query/
    ( go to “Parameters” in the Contents listing)

    Docs and examples on “pre_get_posts” action:
    https://developer.www.ads-software.com/reference/hooks/pre_get_posts/

    The key to getting all this to work is for the action callback code to determine what has been requested so it can conditionally set or unset parameters based on your desire to show or not show certain posts for certain requests.

    I realize this may all sound like an alien language. It kinda is. But like foreign languages, if you focus on one specific need like “Where is the toilet”, it needn’t be all that complicated ??

Viewing 1 replies (of 1 total)
  • The topic ‘Don’t Want To Show New Posts of Sub Section’ is closed to new replies.