Forum Replies Created
-
AuthorPosts
-
unkleeMember
Hi, thanks for replying. I had given up on this idea, not finding any way to do it. I'll check out what you suggest. Thanks.
unkleeMemberI think I've found a solution for the checkbox.
This Subscribe to comments thread on the WordPress forum points out a bug in the Subscribe to comments code at line 168, which is:
add_filter( 'comment_form_defaults', array( $this, 'add_checkbox_to_default' ));
I don't pretend to understand it exactly, but commenting out the line allows the checkbox to appear. So with your help I have the"subscribe without commenting" button, and with that hack I have the "subscribe to comments if commenting" checkbox.
So thanks. Now just to style the comments and buttons (should be OK), and change the comment notes (may be a little more difficult).
unkleeMemberActually, I'm sorry, but I must say I'm still confused. It looks like I can subscribe to comments without commenting, but there's no checkbox to subscribe to comments if I AM commenting. Is that correct, or am I totally missing it?
Thanks again.
unkleeMemberHi Christoph,
You were right. It is working now thanks. I think the problem was that I had been trying to get both this and the Subscribe2 plugin working, I had tried many times with several different email accounts and several different posts, and I got a little confused about what I had tried. Sorry to get that wrong and thanks for your help.
unkleeMemberHi Christoff, thanks so much for your help. Unfortunately, I haven't been able to get it to work, even after deactivating all the plugin, even after switching to another theme (Twenty Sixteen).
There was another person who had problems with this, and later I checked and it was working on her site. I wrote to ask what she did and the reply was that she used this:
add_filter( 'comment_form_defaults', 'custom_comment_form_defaults' ); function custom_comment_form_defaults( $defaults ) { $defaults['comment_notes_after'] = '<p class="subscribe-to-comments" style="clear: both;"> <input id="subscribe" type="checkbox" style="width: auto;" value="subscribe" name="subscribe"> <label for="subscribe">Notify me of follow-up comments by email</label> </p>'; return $defaults;
Dunno if that helps at all, I don't have enough knowledge to know.
One final strange thing. I tried Carasmo's code when she first posted it to me, and it didn't work, but when I deactivated plugins and tried a different theme it appeared to work until I reinstalled the plugins and reverted the theme. But when I do the same now, it doesn't. Again, don't know if that helps.
As an aside, I reckon it would be great if StudioPress wrote a combined subscription plugin.
unkleeMemberI am still trying to get Subscribe to Comments to work. On my trial site I tried deactivating all other plugins and that didn't work. Then I tried changing theme from Genesis/Minimum Pro to the standard WP Twenty Sixteen, and that did the trick.
So it seems that Genesis or Minimum Pro has done something to stop Subscribe to Comments working. Does anyone know anything about this please? If I understood Carasmo's solution (above) would it work?
Any help for a struggling user would be appreciated. Thanks.
unkleeMemberThanks. Now I know what to search for, I can find several ways to do it.
unkleeMemberHi Carasmo,
I'm sorry to take so long to reply. I felt sure I wrote a reply a few days ago, but it's not here - I must have stuffed something up.
I'm afraid I'm just not up to working this out, I'm sorry. I know enough WP and PHP to follow other people's code (generally) and to make minor modifications (e.g. I have added heaps of things to my functions.php file) but this is beyond me. Would you mind giving me a bit more advice please?
1. I presume this code is meant to work in conjunction with the Subscribe to comments plugin?
2. Is there other code I need as well as this?
3. What do you mean by "yourprefix"?Thanks.
unkleeMemberHi Carasmo, thanks for replying. Do you recommend that plugin, or have you used it? it seemed to me to try to do too much, and when I trialled it, it said something about amending my database (can't remember the exact words) and that scared me a little.
unkleeMemberFor the record, I decided not to add the extension and put up with the redirects for a while.
unkleeMemberIn the end, I went a different way. I used a hook to create a new file and then used the file and the Functions.php file to add a custom field just before the footer. See this thread for details - Custom field in footer. Thanks everyone for ideas.
unkleeMemberThanks Victor, that sent me off in the right direction. I knew about hooks, but didn't think of combining them with custom fields.
I wanted to place a different quote in the footer of each page, so just for the record, in case someone else reads this, here is what I did.
1. I created a new custom field named "quote" on one of the page edit pages, and this allows me to select the quote field on each page and enter the quote.
2. I created a new file named quote.php and put it in the Minimum Pro folder. It had the following code:
<?php global $post; echo get_post_meta($post->ID, 'quote', true); ?>
3. I inserted the following code in the Minimum Pro functions.php file:
add_action( 'genesis_before_footer', 'quote_field' ); function quote_field() { echo"<div class=\"quote\"> <div class=\"wrap\">"; require(CHILD_DIR.'/quote.php'); echo"</div></div>"; }
This was a bit tricky. I couldn't get the custom field to appear at the beginning of the footer as I wanted, so I chose to put it before the footer and then style it so it was identical to the footer. To get it to look right in Minimum Pro, I needed it inside a "quote" div and a "wrap" div, and using an echo before and after the quote.php file was called was the way I made that happen.
4. I then styled the div.quote to have the same background os the footer and to have the size text I wanted.
Thanks again. I learned a little more about WP and php through this little puzzle.
unkleeMemberHi Doug, thanks for your thought, I'm learning all the time.
One of the problems with a complex thing like WordPress is not just that I don't know things, but I don't even know that some things exist. So I didn't know there were custom fields, so now I know I have to learn some more about them. I'm even wondering whether I can do my own coding and avoid using a whole plugin for one purpose - but then of course I may find other things I want to do with ACF too!
Widget Logic looks like an interesting plugin. I think my footer quote idea is too complex for this (I have over a hundred static pages) but it may be useful for other things. I use Content Aware Sidebars to create different widget areas on different pages, but this is another way to achieve that result that is worth looking into.
I appreciate all these ideas, for they give me things to check out. Thanks.
unkleeMemberHey thanks Matt, that's very helpful - I couldn't get more pertinent experience than that!
unkleeMemberThanks Victor, I'd never heard of that before, and I didn't know what to search for. It certainly looks like it would do what I want, though I wonder whether it would slow things down as it seems to do so much. Do you have any experience of that?
Reading up on ACF led me to several other plugins that may do something similar: Types, Pods, Custom Field Template and Custom Field Suite. So I will see if any of them are lighter.
Thanks for your help, I wouldn't have found any of them without your suggestion.
unkleeMemberI figured it out. I just copied the code in the js file and substituted '.nav-primary .genesis-nav-menu' for 'header .genesis-nav-menu' and it worked. Too easy in the end.
unkleeMemberHi, I don't know if you're still following this thread, but I am curious. It seems (unless I have missed something, which is always possible) that there were only three differences in your code from what I tried but couldn't get to work, and I'm curious as to the difference.
1. You had 'genesis_before_entry' whereas I had 'genesis_before_entry_content'. This determines whether the image is before the heading or afterwards, and works either way.
2. You had the add_action line after the function, whereas I had it first. I don't think this makes any difference, does it?
3. In the add_action, you had the priority as 1, whereas I had 8. This means the function is executed earlier (than what?) - would this make a difference?
Just curious to learn a little more. Thanks.
unkleeMemberHi, thanks, that seems to have nailed it! I tried something very similar to this that didn't work, but I must have got something wrong. Thanks a lot.
unkleeMemberJust to close this off, I got it working fine thanks. It was easy, I just had a silly mistake. Thanks again.
unkleeMemberI don't know if anyone will ever read this, but I have managed to make the WordPress static home page the home page for the whole website while keeping the WordPress install in the /blog directory and keeping the URL for posts as sitename/blog/postname.
It was actually quite easy, so I thought I'd document it here if anyone else needs to do it.
At the start, the main website (including the home page) was HTML, and the whole WordPress install was in the /blog directory.
1. Go the WP Dashboard, Settings, General and change Site address to the root URL (but don't change the WordPress address) and save.
2. Copy (not move) the WP index.php and .htaccess files into the root.
3. Edit the index.php file (near the end) so that it readsrequire( dirname( __FILE__ ) . '/blog/wp-blog-header.php' );
instead ofrequire( dirname( __FILE__ ) . '/wp-blog-header.php' );
and save.
4. Login to site at old address, go to the Dashboard, Settings, Permalinks and reset permalinks by adding /blog - before I had filename/%category%/%postname/", now I have filename/blog/%category%/%postname%/
5. Amend links in main menu as necessary.All done.
-
AuthorPosts