I have a ghost blog and would like to popup a div element with content inside when the user scrolls halfway through each article.
How would i go about this? I can paste code into the code injection area where it says:
Site Header
Code here will be injected into the {{ghost_head}} tag on every page of the site
You can probably use the ghost_foot inside the code injection option if you want to inject the code into the body of the ghost blog.
If you want to add your code between <head>...</head> then use ghost_head inside the code injection.
Related
how do I inject some
Php code (or a shortcode) into a pre existing div in my header in Wordpress.
I’d like to create a snippet using a snippet plug-in so I don’t have to add it to my header php or functions php then use a banner ad plug-in to control banner visibility. I have a banner plugging ready to go.
Thanks
I can’t find the reference to the output anywhere in the Wordpress theme templates but as I said I don’t want to hardcode anything in. I just want my code to be injected into that div
We have a website developed in Wordpress by a third party. We need to add a java script function and onClick event to an individual page of our website.
The page has a div with some divs that mimic a button. They are just text with anchor tags, inside divs. We are particularly interested in one particular one. (i.e. $2.00 Off Coupon) which when clicked downloads a PDF document. We would also like it to call a function.
In Chrome, when I look at the code for that element, it looks like this (see red circled area):
With in the WordPress admin dashboard, the code for those buttons is not available, as it was custom made by the third-party developer.
e.g.
My Question is, is this code in a template, theme, or page code stored in database? How can I modify this anchor tag to include an onClick event to call the function I need?
Any help to guide me in the right direction would be much appreciated as I am a WordPress Novice.
I think this code located in Page Template file in your WordPress theme.
Try to find file with name page-home.php of something else.
This file should start from this code:
<?php
/*
Template Name: Home
*/
Or try a bad solution to the problem
$('.home-ctas').on('click', 'a[data-emalabel="$2.00 off coupon"]', function(){
// your function
});
I have a page on Drupal, and I need to put an embedded page that renders a 360 img, like an iframe, on a view:
I looked for it on the internet but have not found a solution. I created a tag on that view but I don't know where to put my iframe code to render it.
This is my config tag view:
I see you are using a body field in your view so I guess you'll want to add the iframe to that field?
If thats the case, you can enter the iframe code in your body and put the format on "FULL HTML", you might want to look into your WYSIWYG settings (/admin/config/content/formats in D8) to verify if the iframe tag is allowed.
There's also the option of using the iframe module (https://www.drupal.org/project/iframe) which allows you to add an iframe field.
Good luck
in my case, i create a block and i put the iframe code inside them, after i configure the block to show where i want
This is the creation block
But creating views, does not work because that don't let me modify the content
I've tried deleting blocks, disabling views - the lot! I just can't get this little block to go away!
A block called "Related Forum" is showing up on our knowledge base pages an example is found - here.
I'd like the whole Related Forum block removed from any /help* page:
If I login and hover my mouse over the block, no settings icon appears.
Any idea?
Navigate to the blocks admin page at "admin/structure/block".
There somewhere you should see your block (generated from a view) named something like "View: related forums".
Click configure and change this blocks visibility settings under the "pages" tab at the bottom of the configure page.
If this does not work, check that this block is not being specifically included in a template file.
Another thing that may be affecting it is the context module.
i'm a completely new in Drupal. I'm building a website that in the home page has the typical 3 blocks on the button where you can click and go to some specific page or article.
I create that as Block and I even create that with Nodeblock, they are displayed in the right place and with the right text and images but what I can't make it work is make them be a big link, linked to their article or page, so when user will click it will be directly redirected to the main page.
Something like:
Block: discover
<div>Discover more about our last offer </div>
How can I do that?
I can't find anything close on the web...
Without seeing your site it's hard to say what the best course of action is, however I would suggest using the Views Module.
You could create a block with views and output any field as a link. In the Views UI you can set the url to link to any piece of content above it, using a token value. If you want to link to an item that is not visible, you can hide that field by selecting the "exclude from display" option in that field's settings.
You can also always use css to expand the size of the anchor tag to encompass the entire div.
Here is a tutorial:
https://www.youtube.com/watch?v=3L9JLZOb_LQ
in your block add
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.block-link').each(function(){
jQuery(this).parents('.block').slice('0,1').wrap('');
});
});
</script>