Dandy Plow
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Enter PageCan you get to /about directly? If you type it into your browser’s address bar, is it a page you can access? Or do you get a 404 then, too?
Forum: Fixing WordPress
In reply to: Enter PageOkay, so you go to https://www.yoursite.com and you see the age verification perfectly. No problems. But you submit the age, and you get 404.
Try this–Find
<form method="post" action="">
. Action states what page the user should be directed to when they submit the form. I’m wondering if the fact that WordPress is automatically directing people from https://www.yoursite.com to https://www.yoursite.com/ageverify.php is messing things up.So change
<form method="post" action="">
to<form method="post" action="https://www.yoursite.com/index.php">
Forum: Fixing WordPress
In reply to: Enter Pagethe thing that matters most is the bit after https://www.yoursite.com, so you don’t have to include the full url. Just wondering in terms of /index.php, or whatever
Forum: Fixing WordPress
In reply to: Enter Pagewhat does your browser’s url say when you get the 404?
Forum: Fixing WordPress
In reply to: Enter PageOkay, so change
if($agecheck=="pass") { include(TEMPLATEPATH . '/index.php'); ?> <?php } else { ?> This is where all the code goes for someone who's too young <?php }; ?>
to
if($agecheck=="pass") { ?> This is where all the code goes for someone who's old enough <?php } else { ?> This is where all the code goes for someone who's too young <?php }; ?>
If that works, we know the error lies with
include(TEMPLATEPATH . '/index.php');
.What’s supposed to be happening is that wordpress shows the new age verification page as the default home page. That page is one you created in wp-content/name-of-your-theme/. If someone goes to your site, they see the verification page and enter their birth date. If it’s over 21, the
include(TEMPLATEPATH . '/index.php');
line of could should load your actual Main Index page.Forum: Fixing WordPress
In reply to: Enter PageCouple things to try one-by-one and then test:
1) Make sure line says EXACTLY:
$minimumagetoviewsite = 21
;2) Try removing
<div style="position: absolute; bottom: 0px; right: 0px">
and</div>
3) Where it originally said “This is where all the code goes for someone who’s too young”, replace with
<?php break; ?>
, which would make it very clear on a test if the right reaction was being triggered by someone being too young.Forum: Fixing WordPress
In reply to: Enter PageDefinitely. Right above:
<form method="post" action="">
add:
<div style="position: absolute; bottom: 0px; right: 0px">
Then, near the very bottom, right after:
</form>
add:
</div>
That encapsulates the whole form (boxes and verify button) in a container which has been defined as being 0 pixels from the right side of the window, and 0 pixels from the bottom of the window. So if you find you want it further in or up, just change the “bottom: 0px” to “bottom: 25px”, or whetever number. Same for “right: 0px”.
Tweak and see what you come up with!
Forum: Fixing WordPress
In reply to: How to Create a Custom Tag Template Page?Ah, so between:
…
<?php echo "<img src=\"".get_post_meta($post->ID, 'Tag Image', true)."\">"; ?>
and
<?php $myposts = get_posts('numberposts=-1');
…
insert:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php the_content(); ?> <?php endwhile; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?>
Forum: Fixing WordPress
In reply to: How to Create a Custom Tag Template Page?Sorry–finally did what I should have done in the first place and tested it out, and the code was full of bugs. This now is tried and true:
<?php /* Template Name: Tag Page */ get_header(); ?> <?php $tagpage = get_the_title(); ?> <?php echo "<img src=\"".get_post_meta($post->ID, 'Tag Image', true)."\">"; ?> <?php $myposts = get_posts('numberposts=-1'); foreach($myposts as $post) : $showit = "no"; $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { if(strtolower($tag->name)==strtolower($tagpage)) { $showit = "yes"; } } } ?> <?php if($showit=="yes") { ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php }; ?> <?php endforeach; get_footer();?>
Let me know if that does it
Forum: Fixing WordPress
In reply to: How to Create a Custom Tag Template Page?Just to be sure–Do you mean that you already had a tag page other than what I suggested? Or that you implemented what I suggested and from that you got the introductory text, but not a list of posts matching the tag?
If it’s the latter, there’s an oversight in the code I provided:
The line:
if($tag->name=="x") {
is looking for posts that have a tag of “x”. Replace that line with:
if($tag->name==get_the_title()) {
which should check if there’s a tag that matches the title of the page you’ve created.
Hope that makes sense!
Forum: Fixing WordPress
In reply to: Index page How toThe content above will go in your theme’s main index file. So from your dashboard, go to ‘appearance’ on the left side, and then ‘editor’. Then over on the right side, where all your theme files are listed, click ‘Main Index Template’.
If you replace everything inside the Main Index Template with the code I provided, it will work. But, it’s going to appear very bare bones because it won’t include your theme’s header, footer, or sidebar (if your theme uses one). So if you want to keep those things, the page will look like:
<?php get_header(); ?> <?php get_sidebar(); ?> <?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 }; ?> <?php get_footer(); ?>
Forum: Fixing WordPress
In reply to: Enter PageHmm… What I would do is get into your ftp and find wp-content/themes/the theme you use.
Create a file called ageverify.php (or whatever-you-want-to-call-it.php), and make the contents of it:
<?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") { include(TEMPLATEPATH . '/index.php'); ?> <?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 }; ?>
The only different between this code and the code I gave you earlier is that now, if the person passes the age test, instead of just spitting out “This is where all the code goes for someone who’s the right age”, it uses:
<?php include(TEMPLATEPATH . '/index.php'); ?>
which says to load your “Main Index” page.
Now, all you need to do is go in and create a page and choose the template ageverify.php, or whatever you chose to call it. Then, on your dashboard, go to ‘settings’>>’reading’ and choose “a static page” for “front page displays” and select the page you just created from the drop down.
So now, anytime someone goes to https://www.yoursite.com, they’ll be shown the age verification. If they pass, they’ll get sent to your main index page.
I left out the header from your age verify page, since I’m assuming you’ll have things in there that you don’t want on that page. As a result, the css won’t get called in, so you’d need to style all of this code manually in order to have a background image. You can do that pretty simply by just adding this to the top of your age verify page:
<html> <body style="background: url('https://www.yoursite.com/backgroundimage.jpg');">
Forum: Fixing WordPress
In reply to: Another n00b questionNo need for plugins–get into your FTP and navigate to wp-content/themes/theme you’re using
There, make sure a category.php file exists. If not, create one with this content, otherwise, alter the content to match:
<?php $post = $wp_query->post; if ( in_category('category number of first category') ) { include(TEMPLATEPATH . '/cata.php'); } else if ( in_category('category number of second category') ) { include(TEMPLATEPATH . '/catb.php'); } ?>
This will reroute the user to either cata.php, or catb.php depending on the category.
Next, you’ll need to create and upload cata.php and catb.php to the ftp and give them the content you want.
Forum: Fixing WordPress
In reply to: Videos/ pictures wont show in all postsWhat you’re seeing there is the css. That only defines the appearance of content, not the content itself. So it could change the font size, but wouldn’t make the videos or pics show up.
So it looks like pagelines is a bit funky/different than your usual wordpress theme. I took a look at https://www.pagelines.com/wiki/How_to_Use_Special_Pages and it seems you’ll need to go to “pagelines” on the left menu, then “special”, then “category page”. Once you get in there, just poke around and see if you can find anything referring to excerpts. However they’re listing it, the problem is going to be that they’re showing excerpts rather than full posts. Good luck! Keep digging!
Forum: Fixing WordPress
In reply to: How to Create a Custom Tag Template Page?You’ll need to access your site via ftp, and navigate to your active theme. Copy your index.php file out of the active theme folder, and replace all of the text with this (didn’t get a chance to test but ought to work):
<?php /* Template Name: Tag Page */ get_header(); ?> <?php echo "<img src=\"".get_post_meta($id, 'Tag Image', true)."\">"; ? > <?php $myposts = get_posts('numberposts=-1'); foreach($myposts as $post) : $blockit = "no"; $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { if($tag->name=="x") { $blockit = "yes"; } } } ?> <?php if($blockit=="no") { ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php }; ?> <?php endforeach; ?> </ul> <?php endwhile; get_footer();?>
Now, have the user go in to create a page and choose the “tag page” template on the right.
Make the desired tag the page’s title, put in the introductory text as the content, and then, I think your best bet for the picture is to use a custom field. Scroll down until you see them (if you haven’t used them previously, you might have to go to “screen options” at the top of the page, and make sure the custom fields box is checked. Once they’re visible, find them, click ‘enter new’ and type in ‘Tag Image’. Then, in the ‘value’ field to the right, enter the full url of the image you want to use for that tag.
Hope this gets you started in the right direction!