Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Is this possible?

Featured Replies

Is there a way to have something show up on JUST the front page and not page 2, 3, 4, etc.?

<?php if( is_front_page() ) : ?>
        <div>
<iframe width="640" height="360" src="//www.youtube.com/embed/oCQ3weRdo" frameborder="0" allowfullscreen></iframe>
        </div>
        <?php endif; ?>

I assume, this is WP? If so, on top of my head:

<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
if( is_front_page() && $paged == 1 ) { ?>
    <div>
        <iframe width="640" height="360" src="//www.youtube.com/embed/oCQ3weRdo" frameborder="0" allowfullscreen></iframe>
    </div>
<?php } ?>

Hope that helps :)

Edited by teodora

  • Author

So... that totally worked (yes it is WP btw). Let my ask you this.

 

This code I've placed in the index.php file on the main theme. Is it possible to place it in the functions.php file and have it appear in the same place on the theme?

 

Here's what I have:

get_header(); // Loads the header.php template. ?>

	<?php do_atomic( 'before_content' ); // origin_before_content ?>
	<div id="content">

		<?php do_atomic( 'open_content' ); // origin_open_content ?>


        <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
if( is_front_page() && $paged == 1 ) { ?>
        <div id="welcoming">
<iframe width="640" height="360" src="//www.youtube.com/embed/oCQ3weRdo" frameborder="0" allowfullscreen></iframe>
        </div>
        <?php } ?>



		<div class="hfeed">

			<?php if ( have_posts() ) : ?>

Can I place it there from the child theme functions.php file?

 

There is actually a feature called 'sticky post' on the theme I'm using: http://demo.alienwp.com/origin/

 

If I could populate that area through the functions.php file that would be awesome!! I'm assuming it's an if statement since it only appears if you stick one of your posts.

 

Thanks so much for your help already!

Better option would be just to copy your parent theme's index.php to your child theme. Child's index.php is supposed to override the parent's index.php. Then place the code in child's index.php where you want it to appear :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.