c_chana
Forum Replies Created
-
Forum: Themes and Templates
In reply to: How to show child pages from a parent page automatically?^ this was one of the first things I searched for when I first used wordpress and it seems that there are many others doing the same.
delFUEGO,
the code structure would be something like this:
<?php
$children = mysqlquery();if children == 0 {
//DO NOTHING!
//Maybe add some text here?!
} else {
//Your original sidebar code would go here.
}
?>You would need to run the query to see if there were any children of the page.
Next, you would use an if statement to determine the outcome. The easiest would be to say, if the number of children ($children) = 0, then do nothing, in all other cases, run the sidebar menu script.
I have the mysql query somewhere, I just can find it! when I do I’ll post it here.
Oh, and please excuse my coding as I’m still new to php and wordpress!
Forum: Themes and Templates
In reply to: Edit the layout of a postI’m not 100% sure, but I believe the date functions are held in the following file:
wordpress_directory>wp-includes>functions.php
I quickly tried, but I couldn’t changes to the way the date is displayed, but i only moved two values around.
Forum: Fixing WordPress
In reply to: WYSIWYG template editing tool?there’s no WYSIWYG editor for editing something like that because it’s controlled by the CSS file.
It may be possible to use a program like topstyle to make the changes, which has a small window that vidually shows what changes are being made to the CSS. you could then replace the stylesheet with your edited version.
alternatively, if you know the hex value, you need to change the following value:
background-color: #xxxxxx;
to whatever you require. it appears about 40 lines down in the stylesheet I’m using and you can edit it by going to Presentation > Theme Editor and then choosing Stylesheet from the links on the elft.
Forum: Themes and Templates
In reply to: Would anyone want a theme like this?fantastic looking theme!
Forum: Fixing WordPress
In reply to: Have blog post on different pageare you saying that you require a rich text editior? If so, there’s a setting within WordPress to change this.
If you click on the “My Account” button (top right) and scroll to the bottom of the page, you can toggle the rte on or off.
hope that helps.
Forum: Themes and Templates
In reply to: How to show child pages from a parent page automatically?from what you’ve said, I assume it’s CSS that’s putting the box around the children, and this was something you specifically wanted.
i’m not sure how you would code it, but you would probably need to query the database to get some info.
The best way would be to take the page id and query the database field to find the number of pages with a parent id that is equal to the current page id.
Using an if function, you could then setup two lists, one if the number of children is 0 and another for if the number of children is >0.
Forum: Plugins
In reply to: CSS Treeview Navigation MenuAfter hours of playing and searching, I finally found a (partial) answer to my problem!
I managed to find the wp_list_pages function in the template-functions-post.php page and added a few things to make use of the aqtree3 js menu.
I works great, except that I can’t get the tree to stay open when you move to pages that are within the tree. I’ll mark this topic as resolved once I get that working. I’ll also post a link once the site goes live.
Forum: Plugins
In reply to: CSS Treeview Navigation MenuSorry, I didn’t actually mean categories, I just couldn’t think of a better way to describe the horizontal nav at the top!
I’ll take a look at those links and see if they can help.
Ultimately, I’m after a menue that is something like this:
First shoes:
-HOME
-ABOUT US
-SERVICES
-CONTACT USclicking on, say, services would then display:
-HOME
-ABOUT US
-SERVICES
–WEB DESIGN
–SEO
–HOSTING
–FLASH
-CONTACT USall without refreshing the page (if possible)
Forum: Fixing WordPress
In reply to: Have blog post on different pageI think this is the code that you need. I’ve used it to pull posts to a different page:
<?php
$insideitem = false;
$tag = “”;
$title = “”;
$description = “”;
$link = “”;
function startElement($parser, $name, $attrs) {
global $insideitem, $tag, $title, $description, $link;
if ($insideitem) {
$tag = $name;
} elseif ($name == “ITEM”) {
$insideitem = true;
}
}
function endElement($parser, $name) {
global $insideitem, $tag, $title, $description, $link;
if ($name == “ITEM”) {
printf(“<dt><b>%s</b></dt>”,
trim($link),htmlspecialchars(trim($title)));
printf(“<dt>%s</dt><br><br>”,htmlspecialchars(trim($description)));
$title = “”;
$description = “”;
$link = “”;
$insideitem = false;
}
}
function characterData($parser, $data) {
global $insideitem, $tag, $title, $description, $link;
if ($insideitem) {
switch ($tag) {
case “TITLE”:
$title .= $data;
break;
case “DESCRIPTION”:
$description .= $data;
break;
case “LINK”:
$link .= $data;
break;
}
}
}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, “startElement”, “endElement”);
xml_set_character_data_handler($xml_parser, “characterData”);
$fp = fopen(“http://www.bunker.test/wordpress/?feed=rss”,”r”)
or die(“Error reading RSS data.”);
while ($data = fread($fp, 4096))
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf(“XML error: %s at line %d”,
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
fclose($fp);
xml_parser_free($xml_parser);
?>You can always just asign the default template to the ‘other’ page and create a new, empty template for the homepage (or the other way around)
Forum: Fixing WordPress
In reply to: Editing the content of the dashboardIf you want to edit/remove content from the landing page of the dashboard, just open up index.php in the wp-admin folder in a text editor and you can edit out or add php/static content.
The css can be changed from the style.css file in the same folder.
I’ve previously changed the order of the secondary nav items, so there are a lot of possibilities.
Forum: Themes and Templates
In reply to: How to show child pages from a parent page automatically?thanks carterco! I’ve been searching for something very much like this over the last few hours.
works exactly as I need it too!