converting2wp
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Change text on protected postEsmi’s solution does seem to have a syntax error (mismatched quotes?), but when I made those corrections it still didn’t work.
It appears that a recent change to WordPress broke that solution — at least according to the Codex article on Using Password Protection and my tests on WP 3.5-alpha-21466 (sorry, but I haven’t reset my test environment to 3.4.1).
A different solution from the forums, does seem to work:
function custom_password_form($form) { $subs = array( '#<p>This post is password protected. To view it please enter your password below:</p>#' => '<p>This is the new message.</p>' ); echo preg_replace(array_keys($subs), array_values($subs), $form); } add_filter('the_password_form', 'custom_password_form');Ref: http://ww.wp.xz.cn/support/topic/password-protect-this-post-change-text?replies=6 While it’s for WP 2.6 from four years ago and so may not be using the most recent features, it seems simple enough and the post shows examples of how to add CSS to the form elements.
Forum: Fixing WordPress
In reply to: Condition not workingAre you sure $thumb is set? Are you sure it is a string (so comparison to ” makes sense)? Would something like
!empty($thumb)
instead of
$thumb <> ”work better?
Forum: Fixing WordPress
In reply to: Setting up a content timerYou can set the Publish Date for a post to be at a time in the future.
See the description of “Publish Box” in the Codex page on Writing Posts.
That should work as long as your theme is showing the “most recent special” — just set the time of each post so that it is the earliest time you want that special to appear.
If that doesn’t make sense, a link to your site might help us understand what, exactly, you’re trying to do.
Forum: Fixing WordPress
In reply to: Moving my title graphicThis isn’t the most elegant code, but what if you replace the “$childcats=” line above with
$childcats3 = get_categories(array('child_of' => 3)); $childcats61 = get_categories(array('child_of' => 61)); $childcats = array_merge($childcats3,$childcats61);See array_merge
Forum: Fixing WordPress
In reply to: LIve LinksNo problem with being new — but you might want to review the “Welcome to the Forums” message to pick out some tips.
And I wasn’t suggesting that you’d find an answer in the CalPress-specific forum — just that it might be a better place to ask a question. In particular — this looks like an obvious missing feature (if not a bug) and it needs to be brought to the attention of the plugin developers.
This calendar seems to have a very attractive display of events. However, I’m using the All-in-One Event Calendar (on which Cal-Press says it is based), and ai1ec handles links in the event description just fine.
Best wishes.
I only get that error if the category doesn’t have any children that have posts. So my bad. I should have checked for that.
What if you change my code to
<?php $excludechildren=""; $childcats = get_categories(array('child_of' => 61)); if (sizeof($childcats) > 0) { foreach ($childcats as $key => $cat) { $catids[$key] = $cat -> cat_ID; } $excludechildren = ' AND '.implode(' AND ',$catids); } previous_post_link('%link','%title',FALSE,'3 AND 61'.$excludechildren); ?>If your category 61 does have child categories that have posts, something else is going on.
When you do want all the children of a given category (whether or not there are posts there), you may want to add “‘hide_empty’ => 0,” to the array of parameters for the get_categories function.
Forum: Fixing WordPress
In reply to: Links showing up in calendarThe OP asked again at
http://ww.wp.xz.cn/support/topic/live-links?replies=2#post-3067916Forum: Fixing WordPress
In reply to: LIve LinksIf you’d posted this link on your earlier post you might have received help faster.
It looks as if you’re using CalPress Event Calendar, and I’ve added a tag for that to this post. (But it would have been helpful if you’d said that explicitly.)
I did a quick test, and it appears you’re right. Any links added to the description section of the event don’t appear in the front-end view of that specific event.
You may want to look at the options for plugin support at http://ww.wp.xz.cn/support/plugin/calpress-event-calendar
Or if I’ve misinterpreted things and you’re using a different calenddar plugin, please do let us know what it is.
Forum: Fixing WordPress
In reply to: URL change problemThere are a number of suggestions in the Codex article
If none of those cases apply to you, perhaps you can be more specific about what you’ve tried and what errors occurred.
Forum: Fixing WordPress
In reply to: Slidebar near posts?If you are using the default theme, Twenty Eleven, you might want to check out the plugin http://ww.wp.xz.cn/extend/plugins/twenty-eleven-theme-extensions/
That plugin may not be the final answer for you, but as you get more comfortable with WordPress, you’ll find other ways to address this issue (Google “add sidebars to posts in twenty eleven wordpress” for coding options, choose another theme, etc.).
But the plugin may be a quick fix since it appears you’ve just started using WordPress.
Forum: Fixing WordPress
In reply to: How do I say: if parent = _____ then _____Assuming the page id of Testimonials is 123, then use
if ( 123 == $post->post_parent ) ...See http://codex.ww.wp.xz.cn/Function_Reference/get_post for other properties of the current post that you can reference in the same way.
Note 1: You can use a plugin to display the page id – e.g. Reveal IDs or simply hover over the edit link in the All Pages screen and the ID will show up in the edit URL.
Note 2: If you want to use the page slug (e.g. ‘testimonials’) instead of the ID, see the example http://codex.ww.wp.xz.cn/get_posts#Get_a_post_by_its_slug but change “‘post_type’ => ‘post’,” to “‘post_type’ => ‘page’,”.
Forum: Fixing WordPress
In reply to: How do you write an elseif statement?... <p>Apples</p> <?php } elseif (/* some condition */) { ?> <p>Pears</p> <?php } else { ... ?>See http://www.php.net/manual/en/control-structures.elseif.php
See also switch
A better PHP programmer than I can no doubt write this more compactly, but
<?php $childcats = get_categories(array('child_of' => 61)); foreach ($childcats as $key => $cat) { $catids[$key] = $cat -> cat_ID; } $excludechildren = implode(' AND ',$catids); previous_post_link('%link','%title',FALSE,'3 AND 61 AND '.$excludechildren); ?>Refs: get_categories, implode
You may also want to explore using the get_the_category function (if you don’t want to hardcode the 61).
Welcome to WP!
Forum: Requests and Feedback
In reply to: Full screen editing with formatting buttonshttp://core.trac.ww.wp.xz.cn/ticket/21197 : ALT-Shift-G brings up TinyMCE editor full screen, not DFW (Distraction Free Writing full screen). Opened 4 wks ago. Discussion centers on how to define the keyboard shortcuts, NOT on whether both full screen editors are/should be available. Status closed.
http://core.trac.ww.wp.xz.cn/ticket/21048 : Add editing toolbars to DFW. Status – new, enhancement, no target release. Opened 7 wks ago.
http://core.trac.ww.wp.xz.cn/ticket/20237 : Recommend adding a setting to allow user to choose between TinyMCE full screen and DFW. Opened 5 months ago. Status new, enhancement. In the ticket @azaozz includes code to add the “old” full screen editor button to the toolbar — and that works (tested in clean install of 4.3.1). It shows up at the end of the first line, to the right of the kitchen sink button. It looks exactly like the button to the left of the full screen editor and (at 3.4.1) it shows the same keyboard shortcut, Alt-Shift-G, which brings up the TinyMCE editor, not DFW.
The “micro-plugin” in #20237 still works in the current trunk version, 3.5-alpha-21466 — but the tooltip on the “first” full screen button is now ALT-Shift-W (the correction from #21197), and Alt-Shift-G no longer works — you need to press the added button to get to the TinyMCE full screen editor. And, of course, the icon for the added button is distinguished from the DFW button only by its location.
For all of us who are
- primarily editors, not authors (and so really can’t hide the other parts of the post screen because we may need all those options in our workflow) and
- may be working on systems with relatively small screens,
I’d really appreciate having a button for that second full-screen button on the toolbar (at least as an option – but I realize making it optional would be more than 4 lines of code and one more icon).
I’ll add a comment on #20237.