• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Post Formatting With AJAX Call – Hooks Don't Fire Again?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Post Formatting With AJAX Call – Hooks Don't Fire Again?

This topic is: not resolved

Tagged: Ajax, hooks, posts, query

  • This topic has 2 replies, 2 voices, and was last updated 7 years, 6 months ago by Victor Font.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 25, 2016 at 4:15 pm #182254
    Porter
    Participant

    So I've finally got myself using AJAX, which is amazing, I'm a god, go me (this took me far too long to learn). My issue is, when I output a new query to the page, the format of the posts is all messed up. I believe this is because all of the hooks that fire on the initial load from functions.php, don't fire again for the new posts after I create a new query, but don't reload the page.

    For example, if I had a hook that removed the title, and placed it somewhere else, that doesn't happen when I use ajax to query new posts, right? How does one get around this? Do I need to manually call all hooks that would effect formatting again?


    Buy me a beer? | Try DigitalOcean VPS Hosting

    March 27, 2016 at 11:21 am #182327
    Porter
    Participant

    Bump~

    I could really use some info on this.


    Buy me a beer? | Try DigitalOcean VPS Hosting

    March 29, 2016 at 12:00 pm #182472
    Victor Font
    Moderator

    When you run ajax, you are bypassing the page load and init functions where all of the hooks are run. You are calling data directly from the server. If you want hooks to fire, you need to reload the page. If you are using the jqXHR.always() function, you can try adding window.location.reload();.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble