syncbox
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to add popup page when user goes out of the website?Well, if you want to do it, you can do it this way:
1) create your link to the other site
2) insert your cursor (you must be in html mode) into the link after the closing quote of the href=””
3) hit the spacebar, then type:onclick="target='_blank'"
That will not cause a validation warning you normally would get if using the target attribute in strict xhtml doctypes. At worst, the link will simply open in the same page (should the user not have javascript enabled, which is not typically the case)
Not always a great idea, but certainly asked for by many. I don’t think it’s “spammy” and you could put in a title attribute to tell the user that the link will open in a new browser window or even put that in parentheses after the link.
HTH
Forum: Fixing WordPress
In reply to: Custom Fields area in posts does not have “keys” fieldOh, and if you aren’t seeing custom fields at all, click the Screen Options (top right tab hanging down) and make sure that Custom Fields option is checked.
Forum: Fixing WordPress
In reply to: Custom Fields area in posts does not have “keys” fieldSee where it says “Enter New”?
click that and it will show you a place to type a key
Forum: Themes and Templates
In reply to: How do I assign a specific template to just one category.BTW, if you need to get the ID of a category, you can get into your admin and go to Posts>Categories and hover over the desired category in the list. You should see the ID# in the status bar at the bottom of the browser window…. something like edit&cat_ID=#
Forum: Themes and Templates
In reply to: How do I assign a specific template to just one category.A “theme” is not assigned to just one page. It’s a directory with a style sheet and accompanying files that are used to display the database content USING either index.php, page.php, category.php or single.php based on the type of content (Page Post vs. Category Post(s)).
If you mean creating that custom category.php file, you simply name the file after the category ID of the category you want to have use it. So, if your category is 9, then the file name would be category-9.php and would be uploaded right in with the other files in the theme you are using. All other categories will use either category.php (if there IS one) or index.php (which HAS to be there).
Does that make more sense to you? Let me know if you need more help!
Forum: Fixing WordPress
In reply to: How do I publish my posts to different pages based on categories??You are welcome. I remember how confusing it was for me when I first started using WordPress and trying to decide which type of post to build a site on. I do a lot of sites that use WordPress in for a Content Management System (CMS) so use the page.php and its easy to create and understand page templates – just selecting the template in the Attributes Template menu from the Pages Write/Edit screen in the admin.
I generally use the page.php file and Pages for most sites unless they want a News or Blog function — for content that isn’t replaced when edited but appended… with a need for chronological sorting. WordPress defaults to deciding which file to use to display content based on the post type – category or page, but honestly, they are all posts. You can quite easily use a custom query to display posts from a category in the page.php file. I do it all the time. In fact, you can have multiple loops to show posts from one or more categories AFTER displaying the Page’s content in the original loop.
ASIDE/OPINION:
I honestly wish that WordPress would simply allow the app to have template and “parent-child” global options for Categories.. to allow us to use the same sort of method for selecting a template from a menu for all sub-categories in a category, right from the category’s admin page…. and be able to override that on a per category (child) basis in the child category options.I’ve posted that IDEA: https://www.ads-software.com/extend/ideas/topic.php?id=3243#post-13772
if anyone wants to vote for it. It also poses the concept of having a SORT option applied per Category (on a global level unless overridden by a per (child) category option.
Forum: Fixing WordPress
In reply to: Underscores instead of dashes/hyphens in permalinks – set by defaultNot to mention that when something is underlined (default state of a link’s text-decoration property), it’s sometimes harder to read the url when it uses underscores…
Forum: Fixing WordPress
In reply to: How to remove page titlesBTW, you place // in front of the function to comment it out (inside the php tag) or wrap it with /* */
Forum: Fixing WordPress
In reply to: How to remove page titlesComment out the code in your index or page template: <?php the_title(); ?>
You can delete it but commenting it out leaves it there in case you change your mind.
Personally, I wouldn’t do this. A page title is a good thing for SEO, since it generally repeats what is in the title tag and semantically is high in the heirarchy of what’s considered by search engines.
HTH
Forum: Fixing WordPress
In reply to: reduce space between title and contentOr you can write a new rule that is more specific, like
#content .postarea h1 a {
margin:0;
padding:0;
}which would override the other rule
Forum: Fixing WordPress
In reply to: reduce space between title and content#content h1 a, #content h1 a:visited {
color: #000066;
font-size: 18px;
font-family: Georgia, Times New Roman;
font-weight: normal;
margin: 0px 0px 5px 0px;
padding: 10px 0px 0px 0px;
}make adjustments to the margin-bottom (third value) from there….
Forum: Fixing WordPress
In reply to: Link back to blog, or “home” pageThat all said, if you want to manually add a link to the homepage over by the list of pages, you can manually add one probably to your sidebar.php file
and to get the correct page to display, you set that in Settings>Reading and then to link to it, you use what was said above, either
href=/"
orhref="<?php bloginfo('url'); ?>"
Forum: Fixing WordPress
In reply to: Link back to blog, or “home” pageThe link is generated when the server parses the php that says “create a list of pages” or of categories or whatever.
If you want to manually create a link to your home page – which is typically set in the admin’s settings under “Reading” and you select a WordPress “Page” (static post versus a post in a category) the file that is used IS page.php
The sidebar, when it lists all your pages uses a function named wp_list_pages() which takes additional information, depending upon what you want to display, like whether or not there’s a title for the list or how it’s ordered or what to include or exclude, etc. See the documentation for wp_list_pages() by using the search tool in the documentation section.
In the default theme for WordPress installs, that list is in the sidebar.php file… but you won’t see a “home.php” file listed, just the function that makes a call to the database to find out what to list, based on the page-slug.
When you create a new Page in WordPress in the admin, a page slug is created. This is the “link” name of the file, typically generated on a cleaned-up version of whatever title you gave the page. Note, you CAN edit the slug. If you are using the latest versions of WordPress, you need to click on the Screen Options tab at the top right of the Write/Edit page and check the page slug option to see it. It’s NOT on by default, go figure.
It’s hard not to get technical when trying to explain how WP works… it’s really a GREAT idea to read the basic documentation for WordPress, especially Stepping into Templates and the specific pages about wp_list_categories() and wp_list_pages() and about the WordPress Loop. It’s key to understanding how to get what you want.
HTH
Forum: Fixing WordPress
In reply to: Trouble adding space between sidebar itemsBetter to use CSS to change a property like margin, padding or line-height for the list item in the sidebar… The “heading” of a list of pages, for example, is the
h2
element (assuming the default here, you can control this with the title_li param for wp_list_pages(); )INSIDE an<li>
tag in an unordered list
<ul>
which you CAN apply an id or class to, so a style rule like:li h2 { padding-bottom:1em; }
would affect the space below the heading. If you want to add space BELOW a list of pages or categories, adjust the rule that applies to the list itself (
</ul>
) as in:ul { padding-bottom:30px; }
It helps to understand CSS and honestly, the above is TOO generic. I’d add a class to the tag (eg. ul class=”pagelist”) and define the style’s bottom padding there.
Between the list item, define bottom padding or line-height for li.cat_item or li.page_item… it depends on what type of list.
What I wouldn’t do is use line breaks
<br />
(which is what you would use for xhtml, not<br />
and not</br>
. Nor would I use paragraph tags when not using paragraphical content. Remember, html elements should be semantically correct.If you can point to a site with the examples in mind, a person could be more specific about how to get what you want.
HTH
Forum: Fixing WordPress
In reply to: Link back to blog, or “home” pageAre you using WordPress Pages as in when you create and edit, it’s in the Page section? There is one file – page.php that pulls in the content from the database.
If you are doing posts in categories, likely the file is index.php or if showing a specific category, you could create a custom category-N.php file (where N=the category ID) and that will be used.
There are no “static pages” created and stored in the theme folder for an application like WordPress. But any theme should have the index.php file, header.php file, footer.php file, sidebar.php, etc
Read about templates and template files heirarchy:
https://codex.www.ads-software.com/Stepping_Into_Templateshope that helps