zimmi88
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: automatically convert images from media gallery to postThere’s two ways you could go about this, I think…
- Create or use a theme that uses attachments as the primary post view. Attachments are considered posts within the database and have a place within the template hierarchy (details). If you want to go this route, take a look at WP_Query for more details on how to query posts.
- Hook in to the add_attachment action in WordPress. The documentation on this hook is a little sparse in the Codex, but check out this post on StackExchange for an example of how the hook can be used. In this case, when an image gets uploaded, you’ll use the hook to call a function (probably placed in functions.php of your theme or as a plugin), which will pull up the attachment info and generate a new post from that (see wp_insert_post).
You’ll need to determine based upon your content whether using attachments as the primary post types (in a way) or creating a hook is the more appropriate solution. Both solutions will require some PHP coding (the hook solution is probably a little heavier on the PHP) – the former may also need some HTML/CSS work on the front end.
I hope this helps!
Forum: Fixing WordPress
In reply to: What does Attach in Media Library do?It’s more of an organizational hierarchy rather than some rigid access control system. WordPress doesn’t restrict you from adding images from other posts to new posts. Really, the only times I’ve ever seen “attaching” an image to have functional significance is if you’re using WordPress to generate galleries or list attached media via a function.
(That said, in practical use, I’ve generally just uploaded images on a post-by-post basis, so they get attached by default, which can be useful for said organizational benefits.)
There’s another post on the topic you can check out at https://www.ads-software.com/support/topic/what-does-media-attached-to-a-postpage-mean?replies=4.
I hope this helps!
Forum: Fixing WordPress
In reply to: Using different comment system?For Disqus particularly? Hmm… I don’t know if this is possible. I believe the Disqus plugin hooks in to the comments_template() template tag and overrides WP’s default implementation with its own.
You could try coding something into your theme to use comment function calls in the page.php template without calling comments_template()… might work, but I dunno. Something that says if within a set of page IDs use the custom solution, otherwise use comments_template().
I hope this helps!
Forum: Fixing WordPress
In reply to: How to send a draft before publishingProbably the most straightforward way to go about this would be to copy and paste the text content into an email. That said, if you’re wanting them to review the post as it appears on the page, you could do either of the following:
- Give them a user account that has a high enough permission level to view unpublished posts. For the standard roles, this would be Editor. Before doing this, you’d probably want to establish informal ground rules as to if they can modify the post, as this permission level won’t prevent them from doing so.
- Publish it as a password-protected post and share the password with them. Then, once you want to go live, remove the password and modify the publish date to match the actual go live date. This is probably the simpler way to go about it for both you and the person you’re sharing with.
I hope this helps!
Forum: Fixing WordPress
In reply to: How to add content to sidebar of a pageHow do I do this???(This is what you wrote)
so I’d try that out… toss out the sidebar and put the sidebar content you want for that particular page as part of the page.
Well, you’ve tossed out the sidebar… looking good so far. I notice that the page content isn’t stretching all across the page as desired. Make this change…
In single.php (I think… that’s my best guess where this code lies):
Look for <div class=”grid_16 alpha”> and replace “grid_16” with “grid_23”. That’ll stretch the content across most of the way.Now, as for adding the images back in… I’d try adding the images that were in the sidebar to the post’s content itself as right-aligned images. If that doesn’t look quite right, remove the images from the post and place them in a <div> block as such…
<div style="float:right; width: 225px; margin-left: 10px;><img src="..." alt="Alt text" /><br /><img src="..." alt="Alt text" /></div>
The dots should be replaced with the URL path to the images.
Lemme know if this works ok.
Forum: Fixing WordPress
In reply to: How to add content to sidebar of a pageHmm… ok… let’s see…
1. Haven’t worked with canvas tooo much, but my gut says the styles.css file would be a good place to start. You’d want to modify the CSS record for .header-info h1, which has a font-size attribute in it. The small text under that would be .header-info h2.
2. Are you wanting to replace that whole sidebar area with your Twitter feed? It looks like there’s some content already there that’s pushing your Twitter feed downward. You can also modify the height of the Twitter feed by modifying the height attribute in the pasted script code (where the new TWTR.Widget is defined), as well as removing the padding-top rule from the .slider-info element.
3. In your theme, look for div id=”slides” and add more slides. Follow the syntax of the slides that are already there (div class=”slide”) as a guide. That said, your theme could be dynamically generating these, in which case there’s probably something in your admin panel that you can use to modify the slideshow.
4. You mean where the … is? I’d start by cutting and pasting the code <ul id=”social-logos”>… and modifying from there. Probably some CSS tweaking should do the trick.
Well, after writing that and refreshing the thread to check for updates, looks like the.green.timtam is on the right track with the sidebar issue, so I’d try that out… toss out the sidebar and put the sidebar content you want for that particular page as part of the page.
I hope this helps!
Forum: Fixing WordPress
In reply to: Foreach Loop and PaginationHmmm…. it looks like your query has a LIMIT 20 included… is that working ok? (Dunno if you’re running the code you provided on production or not.)
You could expand the LIMIT parameter to include a starting point. See here for more details. If that’s working, then you’d probably want to use a get parameter (?page=x) for paging. Take the get parameter, multiply by number of items per page, and you have the starting record for your LIMIT query.
I hope this helps!
Forum: Fixing WordPress
In reply to: RSS feedWell, you can try pulling up the feed in your browser and seeing if it works, or running it through a validation service. If you have pretty permalinks enabled, (e.g. your post URLs don’t look like mysite.com/index.php?id=12345) then you should be able to find your RSS feed at…
<yoursitehere.com>/feed
Run your feed through a validation service (here’s a good one) and check for errors. If you’re having trouble figuring out what’s going on from there, feel free to post back.
I hope this helps!
Forum: Fixing WordPress
In reply to: How to add content to sidebar of a pageWell, sidebar implementation is going to vary theme by theme, but the general trend is that one or two sidebars are used across multiple pages on a site, rather than providing a one-to-one relation.
If you want every single page to have a different sidebar (no shared elements whatsoever), probably the simplest way to go about this is to remove the sidebar from the theme’s template file, extend the width of the main content area, and embed the sidebar in the page’s content (create a style for your sidebar and use that style in the HTML).
If you have a relatively small number of pages (something like less than 10-15), you could modify the theme to declare sidebars for each page. In your theme’s functions.php file, you’d want a block that runs a query for all the pages in your site, then runs register_sidebar using the page’s id in the sidebar id.
Something like…
$pages = new WP_Query('post_type=page'); $currpage = null; while( $pages->have_posts() ){ $currpage = $pages->next_post(); register_sidebar(array( 'name' => $currpage->post_title.' Sidebar', 'id' => $currpage->ID.'-sidebar' )); }
Haven’t fully sanity checked that code block, but that should get you on the right track if you choose to go that route. But, once again, I wouldn’t recommend it unless you have a relatively small set of pages. For lots of pages, you’d probably wanna look into removing the sidebar altogether or using a plugin that gives you some control over a block in your sidebar.
I hope this helps!
Forum: Fixing WordPress
In reply to: Please Help, Weird code all over my websiteHmm… did you make any recent changes to your website, such as upgrading or modifying WordPress core, themes, or plugins? It could be a recent change or upgrade that caused this error to appear.
Forum: Fixing WordPress
In reply to: Fatal Error MessagesIt’s not a full reinstall, really. You’re just overwriting the source files for the WordPress core with a fresh copy. Based upon the errors above, either you ran into a weird bug or your copy of wp-includes got mangled somehow.
You’ll need to download the version of WordPress you have installed from www.ads-software.com, then connect via FTP or SFTP to your server and overwrite the server’s copy of wp-includes with the copy you downloaded from www.ads-software.com.
I hope this helps!
Forum: Fixing WordPress
In reply to: Fatal Error MessagesWeird… I’m confused as to why database updates would result in mangled core files. Have you tried overwriting your wp-includes folder with a fresh copy of WordPress 3.3 (it sounds like that was the version you were using… you should use the version you had installed before you started running into issues, then upgrade once things are working again)? I’d start there.
Post back if you’re continuing to have issues. I hope this helps!
Forum: Fixing WordPress
In reply to: Welcome Statement or Log in LinkHmmm… some issues I can see with the above code…
- In the echo statement you have opening and closing PHP tags, which you don’t need and could cause syntax errors.
- There’s a echo printf, which will ultimately result in printing the string, but is a superfluous statement.
- Not sure what’s going on at title=href=”%s”… my guess is that syntax isn’t accurate because it’s not valid HTML. I’d check the documentation for whatever lightbox implementation you’re using for the proper syntax.
- There’s an extra semicolon after the closing brace for the else clause. It won’t generate an error, but it’s not necessary.
Other than syntax issues, it looks like you’ve got the basic idea down… if logged in, get the user info (though if you’re doing this in a header template, I don’t know if this is needed… shouldn’t harm anything, though) and write out the first name, otherwise, show the signup link.
Here’s my guess at what the code should probably look like:
<?php if (is_user_logged_in()){ global $current_user; get_currentuserinfo(); //might not need this line... try running the code without this echo('Welcome to Hookahi ' . $current_user->user_firstname . ' | '); } else { echo '__(<a href="'. get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode(get_permalink()).'" rel="lightbox[registerform]">Register</a>, THEME_NS); } ?>
I hope this helps!
Forum: Fixing WordPress
In reply to: How to hide a page from Google search engine?Well, Google “crawls” sites by following navigational links that are publicly available. So, that means if there’s no link to the page from the public side of your site, and no one else links to it from another site, it’s quite unlikely GoogleBot is going to trip across the page randomly.
That said, robots.txt is really your best bet to block GoogleBot. Yes, there is no mandate from above that says Google has to follow your robots.txt file, but Google, and most other reputable search engines, do. You should also add a meta tag to the specific page to tell robots not to index the page or follow any links on the page.
Robots.txt info: https://support.google.com/webmasters/bin/answer.py?hl=en&answer=156449
Meta tag info: https://support.google.com/webmasters/bin/answer.py?hl=en&answer=93710With respect to WordPress, there’s some additional things you might want to look out for:
- If you’re using an SEO plugin that automatically publishes sitemaps, you’ll want to make sure the page isn’t listed in the sitemap. Check your plugin’s documentation for more info.
- There are a few plugins I’ve seen about that allow you to modify your robots.txt file from within WordPress. Some SEO plugins will also have this functionality. Check the plugin repository to find one that suits your needs.
All that said, if you’re really concerned about information on this page getting out to other people, your best line of defense, other than not putting it online at all, is to put it behind a password or other authentication system.
I hope this helps!
You mean add other information from your posts to every post on your homepage? It’s certainly possible… just add the appropriate template tags to your Loop. WordPress is quite malleable, so if you’re willing to put the time and effort into diving into the lower-level operations, you can do some rather interesting things with it. Currently, your loop only outputs the content of your posts, according to the code posted above. As for whether that’ll cause long loading times or navigation issues, you’ll need to try stuff out and tweak things accordingly.
That said, for comments, the comments_template() function might not work, as it’s designed for single posts/pages. You might need to code a custom solution for this.
As for the aforementioned 30 pixels… are those there when you’re logged out as well? That could be the WordPress Admin Bar peeking in, which pushes content down when it’s added. Otherwise, some CSS tweaks will probably solve the issue.
I hope this helps!