Forum Replies Created

Viewing 7 replies - 46 through 52 (of 52 total)
  • On the main blog page, find this:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    blah blah blah
    
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    and replace it with this:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <?php
    $blockit = "no";
    $posttags = get_the_tags();
    if ($posttags) {
      foreach($posttags as $tag) {
        if($tag->name=="x") {
    $blockit = "yes";
    }
    }
    }
    ?>
    
    <?php if($blockit=="no") { ?>
    
    blah blah blah
    
    <?php }; ?>
    
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    If you go to your dashboard (at https://www.[yoursite].com/wp-admin), you should see “appearance” on the left hand side. Hover over it, then click “editor” from the submenu that pops up. Now, on the right hand side of the page, look for a link to “category”. Click it, and then, in the main editable field that takes up most of the center of the screen, see if you can hunt down any instances of the term “the_excerpt()”, and then replace it with “the_content()”.

    Forum: Fixing WordPress
    In reply to: Enter Page

    Take a look–basically uses a form (which takes up the bottom portion of the code) to request visitor’s month, date, and year of birth. When the form is submitted, that’s when the first part of the code is run. The $minimumagetoviewsite variable can be changed to whatever minimum age you’re looking for, in years.

    If the year of their birth is more than 18 years (as the $minimumagetoviewsite is currently set to) before the current year, they’re accepted. If it’s less, they’re not. If it’s the year in which they turn 18, the code checks if the month of their birth has passed, if not, they’re rejected, if it has, they’re accepted, if it’s the same as the current month, it looks at the date, etc…

    Good luck!

    <html>
    <?php if($_POST['submitted'] != "") { ?>
    
    <?php 
    
    $minimumagetoviewsite = 18;
    $birthmonth = $_POST['month'];
    $birthdate = $_POST['date'];
    $birthyear = $_POST['year'];
    $todaysmonth = date("n");
    $todaysdate = date("j");
    $todaysyear = date("Y"); 
    
    if(($birthyear + $minimumagetoviewsite)<$todaysyear) {
    $yearcheck = "okay";
    } else if(($birthyear + $minimumagetoviewsite)>$todaysyear) {
    $yearcheck = "no";
    } else {
    $yearcheck = "same";
    }
    if($birthmonth < $todaysmonth) {
    $monthcheck = "okay";
    } else if($birthmonth > $todaysmonth) {
    $monthcheck = "no";
    } else {
    $monthcheck = "same";
    }
    if($birthdate <= $todaysdate) {
    $datecheck = "okay";
    } else {
    $datecheck = "no";
    };
    if ($yearcheck=="okay") {
    $agecheck = "pass";
    } else if ($yearcheck=="no") {
    $agecheck = "fail";
    } else {
    if ($monthcheck=="okay") {
    $agecheck = "pass";
    } else if ($monthcheck=="no") {
    $agecheck = "fail";
    } else {
    if ($datecheck=="okay") {
    $agecheck = "pass";
    } else if ($datecheck=="no") {
    $agecheck = "fail";
    }
    }
    }
    
    if($agecheck=="pass") { ?>
    
    This is where all the code goes for someone who's the right age
    
    <?php } else { ?>
    
    This is where all the code goes for someone who's too young
    
    <?php }; ?>
    
    <?php } else { ?>
    <form method="post" action="">
    <select name="month">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    <option>11</option>
    <option>12</option>
    </select>
    <select name="date">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    <option>11</option>
    <option>12</option>
    <option>13</option>
    <option>14</option>
    <option>15</option>
    <option>16</option>
    <option>17</option>
    <option>18</option>
    <option>19</option>
    <option>20</option>
    <option>21</option>
    <option>22</option>
    <option>23</option>
    <option>24</option>
    <option>25</option>
    <option>26</option>
    <option>27</option>
    <option>28</option>
    <option>29</option>
    <option>30</option>
    <option>31</option>
    </select>
    <select name="year">
    <option>1920</option>
    <option>1921</option>
    <option>1922</option>
    <option>1923</option>
    <option>1924</option>
    <option>1925</option>
    <option>1926</option>
    <option>1927</option>
    <option>1928</option>
    <option>1929</option>
    <option>1930</option>
    <option>1931</option>
    <option>1932</option>
    <option>1933</option>
    <option>1934</option>
    <option>1935</option>
    <option>1936</option>
    <option>1937</option>
    <option>1938</option>
    <option>1939</option>
    <option>1940</option>
    <option>1941</option>
    <option>1942</option>
    <option>1943</option>
    <option>1944</option>
    <option>1945</option>
    <option>1946</option>
    <option>1947</option>
    <option>1948</option>
    <option>1949</option>
    <option>1950</option>
    <option>1951</option>
    <option>1952</option>
    <option>1953</option>
    <option>1954</option>
    <option>1955</option>
    <option>1956</option>
    <option>1957</option>
    <option>1958</option>
    <option>1959</option>
    <option>1960</option>
    <option>1961</option>
    <option>1962</option>
    <option>1963</option>
    <option>1964</option>
    <option>1965</option>
    <option>1966</option>
    <option>1967</option>
    <option>1968</option>
    <option>1969</option>
    <option>1970</option>
    <option>1971</option>
    <option>1972</option>
    <option>1973</option>
    <option>1974</option>
    <option>1975</option>
    <option>1976</option>
    <option>1977</option>
    <option>1978</option>
    <option>1979</option>
    <option>1980</option>
    <option>1981</option>
    <option>1982</option>
    <option>1983</option>
    <option>1984</option>
    <option>1985</option>
    <option>1986</option>
    <option>1987</option>
    <option>1988</option>
    <option>1989</option>
    <option>1990</option>
    <option>1991</option>
    <option>1992</option>
    <option>1993</option>
    <option>1994</option>
    <option>1995</option>
    <option>1996</option>
    <option>1997</option>
    <option>1998</option>
    <option>1999</option>
    <option>2000</option>
    <option>2001</option>
    <option>2002</option>
    <option>2003</option>
    <option>2004</option>
    <option>2005</option>
    <option>2006</option>
    <option>2007</option>
    <option>2008</option>
    <option>2009</option>
    <option>2010</option>
    <option>2011</option>
    <option>2012</option>
    </select>
    <input type="hidden" name="submitted" value="yes">
    <input type="submit" name="submit" value="verify">
    </form>
    <?php }; ?>
    Forum: Fixing WordPress
    In reply to: admin area broken

    some caching error? Have you tried it in a different browser?

    Do you use a plugin to style your login?

    Forum: Fixing WordPress
    In reply to: Index page How to

    Using “GET” variables might be a slick way to go. Any time you see something like “?x=y” in the site’s url, it’s able to pass information to the site that you can then use for different things.

    In your index file, try writing something like this:

    <?php if($_GET['site'] == 1) { ?>
    
    Hey, welcome to site 1!
    
    <?php } else if ($_GET['site'] == 2) { ?>
    
    Hey, welcome to site 2!
    
    <?php } else { ?>
    
    <a href="https://www.yoursiteaddress.com?site=1">Go to site 1</a>
    <a href="https://www.yoursiteaddress.com?site=2">Go to site 2</a>
    
    <?php }; ?>

    Basically that tells the browser that if the address contains ?site=1 to say “Hey, welcome to site 1”, if it contains ?site=2, say “Hey, welcome to site 2”, and otherwise to give links to the 2 different sites.

    There’s plenty of different ways to do it, but the benefit is that you can manage all three of the different home pages within your index page.

    If you go into your category template in the theme editor, you should find that you have the function “the_excerpt()” in use. If you replace that with “the_content()”, the full content will appear, including images and videos.

    If you think about it, if they leave your site to go to Youtube, and you still have control of their browser to force them back after the video has ended, you’ve basically created a virus. Once they’ve left your site, you lose control. You can’t tell youtube what to do.

    That said, you could, of course, simply embed the youtube video on your site so that they watch it without leaving,

    or you could use an iframe to imitate them leaving your site for youtube while they actually stay on it. You wouldn’t be able to truly have it redirect once the video ends, but you could set a timer for redirection that is the same as the length of the video.

    But really, what are the chances that someone is going to visit your site, click the link to the youtube video, sit and watch it for the full length, and then be glad that they’re automatically forced back to your site?

Viewing 7 replies - 46 through 52 (of 52 total)