monkeymynd
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Exclude duplicated postsLook here and search on $do_not_duplicate.
Forum: Fixing WordPress
In reply to: what is this error men ?There is a problem in your wp-config.php file on line #1. Look for whitespace or a line break. There’s probably a blank line at the top of the file.
Forum: Fixing WordPress
In reply to: Is there a way to have a page that displays all my blogs?Also, you might gain some insight here:
https://www.ads-software.com/support/topic/231042?replies=14
Forum: Fixing WordPress
In reply to: Is there a way to have a page that displays all my blogs?I’m confused…is your whole site a WP blog? If you’re whole site is already a WP blog, then you need to put some code in the template for your front page to pull in the latest post, or whatever post you want to show there. Then, you’ll have the latest post on the “home” page you have designated, and all of your posts on your “blog” page.
Forum: Fixing WordPress
In reply to: How to- alternating comment background colorsSomething like the code below should work. Where it says, your_class_here you would put in the class name you want for each of the six backgrounds. Leave the quotes around it. So, an example would look like:
echo ‘class=”red”‘;
or
echo ‘class=”blue”‘;
For red background or blue background, but whatever your classes are named.
<ul> <?php $i = 0; ?> foreach ($comments as $comment) : $i++; ?> <li id="comment-<?php comment_ID() ?>" <?php switch ($i % 6) { case 0: echo 'class="your_class_here"'; break; case 1: echo 'class="your_class_here"'; break; case 2: echo 'class="your_class_here"'; break; case 3: echo 'class="your_class_here"'; break; case 4: echo 'class="your_class_here"'; break; case 5: echo 'class="your_class_here"'; break; } ?></ul>
Forum: Fixing WordPress
In reply to: How to- alternating comment background colorsYou would do it the same way as the even/odd method…except, instead of seeing if the number is even/odd, you need to use the “modulus” (%) operator with the number 6. “modulus” returns the remainder after one number is divided by another number.
So, you would loop through your posts, incrementing a $count variable.
Then, when you’re ready to set the bg color, you would use a switch statement:
switch ($count % 6) { case 0: // do stuff for sixth background here break; case 1: // do stuff for first background here break; case 2: // do stuff for second background here break; case 3: // do stuff for third background here break; case 4: // do stuff for fourth background here break; case 5: // do stuff for fifth background here break; } ?>
Forum: Fixing WordPress
In reply to: query_posts…and/or???Worked perfectly! Setting topic to resolved ??
Forum: Fixing WordPress
In reply to: Is this line of coding correct, Can someone help please?Alism, it’s kinda funny that we both reformatted the code the same way though. I felt a little nerdy indenting the code. ??
Dirt2, glad it worked!
Forum: Fixing WordPress
In reply to: Is this line of coding correct, Can someone help please?I’m not a php master, but it appears as if you have an orphaned “else” at the bottom of this code. That’s probably why it’s always loading the last template. Also, is there any reason that you have an if/else for each template and they are loading the same php file?
Try this:
<?php $post = $wp_query->post; if ( in_category('72') ) { include(TEMPLATEPATH . '/fonts.php'); } else if ( in_category('97') ) { include(TEMPLATEPATH . '/brushes.php'); } else if ( in_category('71') ) { include(TEMPLATEPATH . '/vectors.php'); } else { include(TEMPLATEPATH . '/single2.php'); } ?>
Forum: Fixing WordPress
In reply to: Implementing WordPress with my websiteYou just need to install WordPress in a subdirectory
https://codex.www.ads-software.com/Installing_WordPress#In_a_Subdirectory
Then, you’ll need to add a link or menu item to your website that points to your blog.
ie
https://www.yoursite.com/blog
The blog will remain contained in the subdirectory and you can do whatever you want with the rest of your site ??
Edit: I just noticed that the previous poster suggested the same thing at the end of their post. Sry, I missed it somehow.
Forum: Fixing WordPress
In reply to: Is there a way to have a page that displays all my blogs?Here ya’ go!
https://codex.www.ads-software.com/Creating_a_Static_Front_Page
Basically, all of your pages, except the “blog” page will be static pages. You set one as the front page and the others will show on the menu.
If you want a link to your blog page within the front page, then you just create a link and point it to the blog page.
example:
<a href="www.yoursite.com/blog">Check out my blog</a>
“blog” would be whatever you name your blog page.
Forum: Fixing WordPress
In reply to: Displaying posts assigned to ANY 2 categoriesSee here for full text: https://codex.www.ads-software.com/Template_Tags/query_posts
Category Parameters
Show posts only belonging to certain categories.
* cat
* category_name
* category__and
* category__in
* category__not_inShow One Category by ID
Display posts from only one category ID (and any children of that category):
query_posts(‘cat=4’);
Show One Category by Name
Display posts from only one category by name:
query_posts(‘category_name=Staff Home’);
Show Several Categories by ID
Display posts from several specific category IDs:
query_posts(‘cat=2,6,17,38’);
Exclude Posts Belonging to Only One Category
Show all posts except those from a category by prefixing its ID with a ‘-‘ (minus) sign.
query_posts(‘cat=-3’);
This excludes any post that belongs to category 3.
Multiple Category Handling
Display posts that are in multiple categories. This shows posts that are in both categories 2 and 6:
query_posts(array(‘category__and’ => array(2,6)));
To display posts from either category 2 OR 6, you could use cat as mentioned above, or by using category__in (note this does not show posts from any children of these categories):
query_posts(array(‘category__in’ => array(2,6)));
You can also exclude multiple categories this way:
query_posts(array(‘category__not_in’ => array(2,6)));
Forum: Fixing WordPress
In reply to: Menus/Posts/Pages/Categories Confusion-Nothing WorkingI’m not sure I’m following you properly, but I’ll give it a shot.
First off, let’s start with the confusing posts & order. I’m wondering, did you mean for categories Copy&Content, News, Politics & Web to be sub-categories of Portfolio? If you make them parent categories instead, I think you’ll get them all grouped the way you like. You “home” blog page, ie. “Blog Posts” on you site, will always show a mixture of all categories (in descending date order) unless you customize it.
As far as your links go, your template needs to have the proper code in it to support the link categories. You may want to switch to a newer/different template so that you can see how it should lay down.
What plugin did you download for the contact page?
Forum: Fixing WordPress
In reply to: multiple blogs on one site, questionYou might want to start with “The Loop”: https://codex.www.ads-software.com/The_Loop
Here are some more “advanced” loops: https://codex.www.ads-software.com/Template_Tags/query_posts
And, finally, by category: https://nitzan.co.uk/the-wp-loop-via-category/
Forum: Fixing WordPress
In reply to: How do I embed shortcuts on the same page?Looks like you’re looking to use internal anchors. See here: https://www.echoecho.com/htmllinks08.htm
and here: https://www.yourhtmlsource.com/text/internallinks.html