bu130932
Forum Replies Created
-
Done. Thank you again!
No, I had not thought of that. But I’ve tried it now and it works perfectly!
Thank you so much!
Forum: Themes and Templates
In reply to: Post without title insert permalinkI’m not sure if there are other ways to do it, but I usually use the ‘the_title’ filter hook.
Try something like this:function stham_the_title ( $title ) { if ( in_the_loop() && ! is_page() ) { if ( ! $title ) $title = __( 'No title', 'stham' ); } return $title; } add_filter( 'the_title', 'stham_the_title' );However, the above only changes the title in the blog listing page (if I remember correctly). The title could still be blank in other spots, e.g. between your <title> tags (you can use the ‘wp_title’ filter hook for that). I can’t quite remember now what other spots might still be sporting a blank post title. Just check carefully when you’re doing your testing.
For more info:
Hooks
the_title
wp_titleI may be wrong here but I believe all posts will have permalinks. WordPress will auto-generate the permalink based on your post’s title. If there’s no title, I believe it uses the post’s ID.
Also, the_title() is not suitable to be used as part of the title attribute in a link. Use the_title_attribute() instead.
Hope that helps.
Forum: Plugins
In reply to: How to go about a featured post?You should be able to do that with some coding.
You can use the pre_get_posts hook to control the loop but remember to check that you are modifying it at the right spots. So do some checks, for e.g.:
function stham_mod_query( $query ) { if ( $query->is_home() && $query->is_main_query() ) { // blah blah blah } } add_action( 'pre_get_posts', 'stham_mod_query' );You can also use the get_posts() function to get the posts you need by setting some parameters:
WP_Query Pagination ParametersYou would have to limit the number of featured posts displayed to only 1 and ignore all the others since there’s no limit to how many featured posts you can have:
Display Sticky PostsI’m not a whiz at development but I hope the above helps a little.
Forum: Fixing WordPress
In reply to: Post showing "page not found" even though it is showing on my blog.Ah, my apologies. I was looking at the list of links near the bottom of your article.
Go back to the Edit Post screen for the post. Beneath the post’s title, you should see the permalink to your post. The permalink should say “http://agentwithresults.com/tomball-tx-first-time-home-buyers-guide-the-home-offer/”
If it doesn’t, click on “Edit” and enter the correct permalink. The front portion of the link (i.e. your domain) isn’t editable but that’s okay. Just enter “tomball-tx-first-time-home-buyers-guide-the-home-offer” into the back portion. And click on “OK”.
If that still doesn’t work, you can also try to go to Settings -> Permalinks. Click on “Save Changes”. Sometimes the permalink settings need to be saved twice.
Forum: Plugins
In reply to: How to go about a featured post?Could you explain a little more about the “broken experiences”? Are you referring to the featured post showing up twice – once at the top of page 1 and again in its original position in the queue of posts in the subsequent pages?
Forum: Fixing WordPress
In reply to: How to get page content with template applied?I don’t quite understand what you mean by “with its template applied”, but you can use get_page_by_path() to retrieve a particular page and its contents if you know its path. It will return a WP_Post object containing information such as title, excerpt, content, etc.
If you just want to call a template file from within another template file, you can use get_template_part(). What this does is it pulls in the contents of one template file and sticks it in a particular spot. It works just like get_header() and get_footer(), and you can specify which template file you want to pull in.
If what you need to do is read/write to local files, you can use WordPress’s Filesystem API:
Filesystem API
Tutorial: Using the WP_Filesystem
WordPress Filesystem API: the right way to operate with local filesHope one of the above is helpful.
Forum: Fixing WordPress
In reply to: Post showing "page not found" even though it is showing on my blog.The links could be broken.
You can try the following:
- Go back to the Edit Post screen for your post.
- Highlight the broken link and click on the “Unlink” button (or hit Alt + Shift + S) from the top of your editor.
- Then, click on the “Insert/edit link” button next to it (or hit Alt + Shift + A) and you will see a pop-up.
- Scroll through the list of content until you find the post you want to link to. Select that line.
- Click on “Add Link”.
Hope that works.
Forum: Themes and Templates
In reply to: Directory Theme – Home Search FreezesTo find out if it’s one of the plugins causing the error, you have to disable all the plugins and then re-enable them one at a time and test the search again.
Is the “Allow Comments” box for your home page also unchecked?
It’s located under Pages -> All Pages. Find your home page and click on “Quick Edit”. The checkbox is in the column on the right.
Forum: Fixing WordPress
In reply to: How to change contact infoI took a look at your site and noticed that you are using a theme called Simple’n’Bright. If that is correct, then the option for changing your address in that theme is located under the theme’s options.
In your admin area, go to Theme Options -> Contact. You should see a list of fields for your contact info.
Hope this helps.
Forum: Themes and Templates
In reply to: Editing code for specific pagesAre you using a commercial theme? If you are, you can ask the vendor whom you purchase the theme from for help.
Otherwise, you may need to find the Template file within your theme folder in order to edit the line of text. The actual file name differs theme from theme so you might have to do a little bit of digging. It could be called single-portfolio.php.
http://codex.ww.wp.xz.cn/Post_Types#Custom_Post_Type_TemplatesHope that helps.
Forum: Fixing WordPress
In reply to: How to change contact infoI’m sorry about your husband’s passing. Could you provide a link to your site so we can try to work this out?
Forum: Fixing WordPress
In reply to: Can't change this "header", if it even is oneThat line looks like it could be (or is supposed to be) a text version of the site’s logo. Have you tried looking in the theme’s options? Some themes allow you to use a text in place of an image logo in their options.
Forum: Fixing WordPress
In reply to: Hacked Line of Code on PageHi,
Your friend’s site looks like it has been infected with Blackhat SEO Spam.
You can try the suggestions posted by Krishna on this thread.
I also tried running the site through
Sucuri’s SiteCheck Scanner and there were 2 pages which looked like they may (or may not) be contributing to the problem: 404testpage4525d2fdc and 404javascript.js.If they’re not pages that your friend’s site needs, I would suggest removing them, even if they are not the root cause of the problem.
Hope this helps.