If it is a page
the global post
object is already set when wp_head
fires. But you have to get the data for this page with custom code.
Pseudo code:
add_action ( 'wp_head', 'wpse_58539_get_ogp' );
function wpse_58539_get_ogp()
{
if ( ! is_page_template( 'your-template-name' ) )
{
return;
}
$page = get_post( $GLOBALS['post'] );
// Inspect the page meta data to find the taxonomy and the images.
// print the OGP data
return;
}
Related Posts:
- Why is there no global function in wordpress to return the output of any function call?
- My theme is adding an unmatched end tag and outputting it to my screen
- How to show tags in posts with a theme that does not do it
- Using OOP in themes
- How can I allow the Editor Role to change Theme Settings?
- Am I allowed to license my WordPress theme under the aGPL
- Best way to include Bootstrap in WordPress
- Undefined offset: 0 in > […] /wp-includes/capabilities.php on line 1067
- Editing Links in the Footer of WordPress Themes with Base64 Encrypted Code?
- How to automatically highlight syntax of code in a post?
- register_theme_directory and broken deploys
- switch a theme different per user role
- Extra User Profile Field Upload File / Image
- Register theme customizer settings when theme activates [duplicate]
- Can I obtain differents links for different installed theme?
- hfeed CSS class in Twentyeleven Theme
- Will activating a different theme preserve custom settings to current theme?
- Which is the most well coded and semantically correct naked/blank WordPress theme (based on WordPress coding standards)?
- How to change the themes “Live Preview” url within the Appearance->Themes page?
- What tags should be used for themes to show the type of layout?
- How do I apply my CSS to a theme page?
- How do you get thumbnails to show up in the admin edit post?
- How to get the post-ID in my plugin?
- Parallax WordPress theme without hardcoding – possible?
- Embedded Videos (PB) – Not Available
- Recommended Themes for a Developer-related Topics Blog?
- none of my css is working in my child theme
- Finding wordpress file in theme editor using the theme name
- Private theme update with zip archive without deactivating the theme
- Displaying a widget in sidebar only when no other widgets rendered?
- New custom theme option (text input) giving index error
- Upgrading from 2.9.4 to 3.0.x and with a custom theme
- CSS for triggering Avada toggles using an image or clickable element [closed]
- Published site reverts without changes to theme
- Change WordPress Theme automatically for A/B test
- Search form not finding content in template page
- Files empty after moving with FTP
- Open Graph in posts loop page
- Full page (no WP admin menus and options) admin theme options
- How to use one theme for multiple WordPress sites?
- Update wordpress theme without customization loss
- Make multiple pages and set template/content on theme activation?
- How to transform a custom made static HTML website to a WordPress website [closed]
- Need to edit themes HTML code
- Any Good WordPress Themes Compatible With The BBPress Plugin? [closed]
- Newbie wordpress question re banner height
- How to add custom JS file in WordPress Child theme with get_theme_file_uri
- Adding the jQuery to my theme that already exists in WordPress?
- Interpretation and explanation of register sidebar
- Changing input type from text to multi select dropdown – skill taxonomy
- How to access theme fonts using custom CSS style? [closed]
- Removing the references to the wp-content folder
- What data does WordPress theme update pull If there is an update?
- Commas in Tag Cloud
- Cannot update a file for my theme
- Do all themes accommodate all features?
- How to reduce Header at the top of the page
- Custom fields not displaying on front end
- remove theme’s name from dashboard .. How?
- how to stop a gallery slideshow
- Change “published by”
- Theme seems to be preventing me from adding a new page to my site
- WordPress margin issues
- 12 column grid layout
- Remove style id inline CSS in WordPress
- How to find file that placed a line in my header
- Where to find child themes?
- Theme check warning about text domain
- dynamic image path within a javascript file
- how to create a section inside a section with theme options customizer
- Warning: call_user_func() expects parameter 1 to be a valid callback
- theme continuous deployment from bitbucket to windows azure
- Changing themes on locally hosted webpages
- Changing admin Textarea to integrated WP editor
- Line break no working on theme
- What is the template file for topic layouts in bbPress?
- Style of a theme
- Orion theme (from theme forest) [closed]
- QA/Staging envirnoment for wordpress sites
- Showing wordpress theme demo at front end
- Diagnosing a connection reset problem
- Moving WordPress with Super Skeleton theme
- Customising a theme
- Blog shows up without Theme/CSS styles
- Boldy theme – Regarding the images above the boxes
- Symbolic Links for themes – linking one theme to many wordpress installs
- Fatal error: Call to undefined function get_header() and BuddyPress [closed]
- A problem with functions.php file on my WordPress site
- hardened wordpress linux install
- which theme is this? [closed]
- JQuery Error in theme for .live is not a function [closed]
- How can I either move the nav bar down or create more space for the header? Theme – Ajaira
- How do I remove the dash (-) between my Site Title and Tagline?
- WordPress Theme redirects to the Index page – Theme customizer problem
- Obtaining the original unchanged Theme [closed]
- How to assign posts to different themes? [closed]
- Using AJAX to Update WordPress Theme
- Absolute and relative paths
- Help!!! Old theme doesn’t load scripts and conflitcs with plugins
- Fatal error Class-wp-hook, again, but not sure what’s triggering it