Big Bagel
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Need to add variable to functionYes, using an array is more readable. I was using the periods in my first example as an ellipsis. Until his last post (which I believe was probably a just a mistake) he was using double quotes. There’s no problem there.
You don’t need to use periods to concatenate a string with a variable if you use double quotes.
All of these work:
wp_list_bookmarks("category=$link");
wp_list_bookmarks("category=" . $link);
wp_list_bookmarks('category=' . $link);
Using his current code, he would want a string rather than an int, which is exactly what
get_post_meta
with it’s last argument set to true will return every time. Checking that it is a string (or int) is not needed.Forum: Fixing WordPress
In reply to: Need to add variable to functionThe double quotes causes any variables to be processed:
"text...$link...text"
and
'text' . $link . 'text'
and
"text" . $link . "text"
will all have the same result.
Also,
get_post_meta
(what $link is being set to) never returns null (it’s good to check if a variable is null before using it, but is a bit unnecessary here). If it can’t find anything it returns an empty string (which is why, if you get rid of the conditional, wp_list_bookmarks still works as if the category argument was set as an empty sting).Forum: Fixing WordPress
In reply to: Custom Post Type List PageMokay. Did you try adding the paged argument to your query_posts call? For example:
query_posts( 'post_type=newPostType&paged=' . get_query_var( 'page' ) );
According to the codex on WP_Query that should do the trick.
Forum: Fixing WordPress
In reply to: Need to add variable to functionThe problem seems to be that
get_post_meta
is retuning an empty string (it does this when it can’t find the key requested), which would result in exactly what you’re seeing. Everything looks good and is set correctly…bah.If you want to try a little troubleshooting, you could put this bit in:
$test_id = get_the_ID(); $test_keys = get_post_custom_keys( get_the_ID() ); $test_value = get_post_meta( get_the_ID(), 'links', true ); echo '<!--' . $test_id . '-->'; echo '<!--' . $test_keys[0] . '-->'; echo '<!--' . $test_value . '-->';
Then you can check the page’s source code to see the values (after clearing any cache of course). Maybe the key is getting stored strangely? After all the troubleshooting someone will probably show up and find the problem in 5 seconds.
Forum: Fixing WordPress
In reply to: Custom permalink 404 ErrorThat rule (
RewriteRule ^index\.php$ - [L]
) was added to the default WordPress .htaccess rules sometime around version 3.0. Your rules look fine.Forum: Fixing WordPress
In reply to: Custom Post Type List PageI’ve never done this myself so I’m wary of giving any specific advice, but I think this link shows what you’re after.
Edit:
Hrm…That link is a little old; I think there’s an easier way. Try adding:'paged=' . get_query_var( 'page' )
to your query arguments.
Forum: Fixing WordPress
In reply to: Custom permalink 404 ErrorUsing only /%postname%/ will only cause problems like this when you have custom post types or a post uses a title similar to a category, page, etc. You can go a long time (indefinitely if you’re very careful) before problems start popping up.
Try switching to one of the non-custom permalink settings. At the very least it’ll tell you if that’s where the problem lies.
Forum: Fixing WordPress
In reply to: Custom permalink 404 ErrorRead up on permalink usage here (specifically, the structure tags sections). If you use only /%postname%/ as your custom permalink setting it can cause various issues. One of the problems I’ve seen in the past is WordPress getting confused and producing random 404’s.
Forum: Fixing WordPress
In reply to: Need to add variable to functionJust tested it in my dev site; works fine for me.
Assuming what you posted is the exact code you’re using, make sure to add a semicolon on the second line:
$link = get_post_meta( get_the_ID(), 'links', true );
And just to triple check: Make sure that the post’s custom field name is exactly “links”, that the post’s custom field value is the ID number for the link category you want (ex: 3), and that you’re using this code in the loop.
Forum: Fixing WordPress
In reply to: Need to add variable to function<?php $link = get_post_meta( get_the_ID(), 'links', true ); if ( $link ) { wp_list_bookmarks( "title_li=0&categorize=0&category_name=0&category=$link&show_images=0&show_description=1&after=<br />&orderby=url" ); } else { echo 'No bookmarks.'; } ?>
With the “between” argument you can add whatever string you want between the link and the description.
Forum: Fixing WordPress
In reply to: Need to add variable to functionAssuming the custom field is a string, that you don’t want the bookmarks to show if the field wasn’t set, and that you’re in the loop, I’d try something like:
<?php $custom_field = get_post_meta( $post->ID, 'links', true ); if ( $custom_field ) { wp_list_bookmarks( 'categorize=0&category=' . $custom_field . '&before=<span>&after=</span>&show_images=1&show_description=1&orderby=url' ); } ?>
*not tested
Edit:
Dangit! That’s what I get for taking so long to post.Forum: Fixing WordPress
In reply to: How To Hide Blog Title & Description On Single PageThere are a few ways Weaver could conditionally remove the visible title. As long as a
<title>
tag is being generated (completely separate from the visible title on the page) search engines and browsers will use that as a page’s title. You can look at the source code of one of the pages with the hidden title and look for something like<title>I'm the title</title>
near the top.If Weaver isn’t adding a title tag on pages that have their visible title removed or on any pages (which is why a search engine would fall back on guessing the title from text on the page) then you might consider one of the SEO plugins available in the repository. You can also manually add an automatically generated title tag in the php. The more popular SEO plugins have a lot of nice features, but If you decide to go the manual route I can look at Weaver and let you know what to do.
I think the timing of Google indexing that page was just coincidental; it should index the page regardless of any visible title or title tag. It can take a few days (or longer) for search engines to add pages. While I’m happy to help, if you have any theme related questions or problems, starting a topic under Weaver’s theme repository page or in Weaver’s support forum would probably get you some faster, more specific responses from people that are more knowledgeable about the theme.
Forum: Fixing WordPress
In reply to: How to disable core.000 files from generatingI’m pretty sure that plugin doesn’t have anything to do with those files. Also pretty sure WordPress itself doesn’t make those files. I think those files are core dumps generated by your server; you should probably ask your web host about them.
Forum: Fixing WordPress
In reply to: How to set up static page?As for the new question (it’s usually better to start a new topic): I think the option is hidden until you have at least two pages created. This could help if you haven’t read it already:
https://codex.www.ads-software.com/Creating_a_Static_Front_Page
Forum: Fixing WordPress
In reply to: How To Hide Blog Title & Description On Single PageIf the original poster still needs help after nine months, then the exact code would be:
<?php if ( ! is_page( 'newsletter-sign-up' ) { ?> <?php if (is_home()):?> <h1><a href="<?php echo home_url( '' ); ?>/"><?php bloginfo('name'); ?></a></h1> <?php else:?> <h3><a href="<?php echo home_url( '' ); ?>/"><?php bloginfo('name'); ?></a></h3> <?php endif;?> <div class="description"><?php bloginfo('description'); ?></div> <?php } ?>
The bit inside the conditional is already in “header.php”; I just added it to make clear what part to surround.
A slightly easier way would be to use the conditional already in place; replace this line:
<?php if ($options[$shortname . '_show_blog_title_and_description']=='yes'):?>
with:
<?php if ($options[$shortname . '_show_blog_title_and_description']=='yes' && ( ! is_page( 'newsletter-sign-up' ) ) ):?>
As for the new question, I don’t use the Weaver theme so I have no idea what its file structure is or how it goes about doing things and without seeing the generated code of your site I can’t infer how it works. The code your looking to alter is usually found in the theme’s “header.php” file. If you find the code used to display the title…
Probably looks something like this:
<h1><?php bloginfo('name'); ?></h1>
…then you can wrap it in a conditional that causes it to refrain from displaying on the “front” page:
<?php if ( ! is_front_page() ) { ?> <h1><?php bloginfo('name'); ?></h1> <?php } ?>
If your site’s styling goes wonky without having that <h1> tag (or whatever tag used in displaying the title) then you could do something like:
<?php if ( ! is_front_page() ) { ?> <h1><?php bloginfo('name'); ?></h1> <?php } else { ?> <h1></h1> <?php } ?>