kyllle
Forum Replies Created
-
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] Displaying post meta in post?Nevermind, got it!!
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] Displaying post meta in post?Actually I see it when I call
wp-json/wp/v2/postsbut how would I go about seeing it when I gowp-json/wp/v2/events-api?Forum: Plugins
In reply to: [WordPress REST API (Version 2)] Displaying post meta in post?Hey! Thanks for the response, I’m not totally sure how I use the code on the example page to hook this to my
eventscustom post type. Basically I want to seeevent_urlfrom postmeta but I’m not completely sure, I’m not overlay familiar with PHP more focused on the front end. Could you possibly point me in the right direction, I added the following code:add_action( 'rest_api_init', 'slug_register_event_url' ); function slug_register_event_url() { register_rest_field( 'post', 'event_url', array( 'get_callback' => 'slug_get_event_url', 'schema' => null ) ); } function slug_get_event_url( $object, $field_name, $request ) { return get_post_meta( $object[ 'id' ], $field_name ); }Hey,
Haven’t figured it out I’m afraid, the output gets placed in a div which I’m just hiding in the css at the mom!
Hey,
Absolutely no updates to the functions.php, just noticed this today and can’t understand where the issue lays. No code has been updated or anything :/
Any suggestions?
Kyle
Forum: Themes and Templates
In reply to: Allow adblock users to enter my website with Avada themeHey,
The problem is some script being loaded on page initialise linked to a marketing company call cpalead. The page loads and then a script is used to fire off an event to cpalead, this is being caught by adblocker and hence you get the blocked message. If you go in to the header.php file of the Avada theme and go to around line 122 you’ll see the comment <!–Header Styling–>
The script below this is the offender, if you remove this all should be good for you 🙂
<script type="text/javascript">var isloaded = false; </script><script type="text/javascript" src="https://www.cpalead.com/gwjs.php?pub=222255&gateid=NTQ0NTE1"></script> <script type="text/javascript">if (!isloaded) { window.location = 'http://www.cpalead.com/abp'; }</script> <noscript><meta http-equiv="refresh" content="0;url=http://www.cpalead.com/java" /></noscript>Forum: Fixing WordPress
In reply to: How to create data attribute containing post id in main nav?Hey,
Do you mean get the id from the page-item-{ID} class? I could certainly grab this number using javascript but surely there’s a way to output just that number somewhere to directly grab ?
Forum: Fixing WordPress
In reply to: How to create data attribute containing post id in main nav?Absolutely nothing, markup stays the same as before. What would you expect to happen there?
Kyle
Forum: Fixing WordPress
In reply to: How to create data attribute containing post id in main nav?Hey,
Thanks for the reply! I’m not entirely sure how I modify the $items_wrap param to include that data attribute. Trying out a couple of different snippets never altered the outputted markup. Can you advise?
Using
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'items_wrap' => '<ul class="test">%3$s</ul>' ) ); ?>as test for example doesn’t output .test anywhere?Forum: Fixing WordPress
In reply to: How to displaying an element on a specific page?Adding your code snippet into content-single.php triggers a page erro about the } ?
Forum: Fixing WordPress
In reply to: How to displaying an element on a specific page?hi i want to place this code in the content-single.php page?
Forum: Fixing WordPress
In reply to: How to add a price field to my postYeah this could work, but is there a way of having a box that is permanently part of the post that I can entitle ‘Price’?
Thanks
KyleForum: Fixing WordPress
In reply to: Repeat content across various posts and pagesHi esmi,
Thanks for that, il check it out!
Kyle
Forum: Fixing WordPress
In reply to: Exclude a category from main loopHi Alchymyth,
Thanks loads for this!
Kind regards
KyleForum: Plugins
In reply to: eshop – displaying eshop product order form outside the_content?Excellent! Thanks loads for this Rich!